projects
/
pazpar2-moved-to-github.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
d537f96
)
Handle repaging on rotate
author
Dennis Schafroth
<dennis@indexdata.com>
Fri, 16 Dec 2011 12:50:46 +0000
(13:50 +0100)
committer
Dennis Schafroth
<dennis@indexdata.com>
Fri, 16 Dec 2011 12:50:46 +0000
(13:50 +0100)
www/mobile/mobile_client.js
patch
|
blob
|
history
diff --git
a/www/mobile/mobile_client.js
b/www/mobile/mobile_client.js
index
640b406
..
58da345
100644
(file)
--- a/
www/mobile/mobile_client.js
+++ b/
www/mobile/mobile_client.js
@@
-35,7
+35,7
@@
var tab = "recordview";
var triedPass = "";
var triedUser = "";
var triedPass = "";
var triedUser = "";
-var previousOrientation = 0;
+var previousOrientation = window.orientation || 0;
window.addEventListener("load",function() {
window.addEventListener("load",function() {
@@
-47,27
+47,27
@@
window.addEventListener("load",function() {
});
function calcRecPerPage() {
});
function calcRecPerPage() {
- state.recPerPage = 5;
state.width = window.innerWidth;
state.height = window.innerHeight;
state.width = window.innerWidth;
state.height = window.innerHeight;
- state.recPerPage = Math.max(Math.round((state.height - 88 - 40) / 60), 5) ;
-
+ return Math.max(Math.round((state.height - 88 - 40) / 60), 5) ;
}
function checkOrientation() {
}
function checkOrientation() {
- if(window.orientation && window.orientation !== previousOrientation){
- previousOrientation = window.orientation;
- calcRecPerPage();
+ if(state.height != window.innerHeight){
+ var newPageSize = calcRecPerPage();
+ //alert("orient change: Dimension " + state.width + " " + state.height + " Old Rec/page " + state.recPerPage + " New: " + newPageSize);
+ state.setRecPerPage(newPageSize);
+ my_paz.show(state.getStartWith(), state.getRecPerPage(), curSort);
}
};
}
};
-calcRecPerPage();
+state.setRecPerPage(calcRecPerPage());
window.addEventListener("resize", checkOrientation, false);
window.addEventListener("orientationchange", checkOrientation, false);
// (optional) Android doesn't always fire orientationChange on 180 degree turns
window.addEventListener("resize", checkOrientation, false);
window.addEventListener("orientationchange", checkOrientation, false);
// (optional) Android doesn't always fire orientationChange on 180 degree turns
-setInterval(checkOrientation, 2000);
+//setInterval(checkOrientation, 2000);
var imageHelper = new ImageHelper();
var imageHelper = new ImageHelper();
@@
-946,7
+946,7
@@
function showDetails (prefixRecId) {
}
// request the record
displayLoading()
}
// request the record
displayLoading()
- my_paz.record_with_query(recId);
+ my_paz.record_with_query(recId, state.simpleQuery);
}
function replaceHtml(el, html) {
}
function replaceHtml(el, html) {