[OpenLayers-Commits] r11240 -
sandbox/camptocamp/mobile/openlayers/examples
commits-20090109 at openlayers.org
commits-20090109 at openlayers.org
Tue Feb 22 09:31:43 EST 2011
Author: fredj
Date: 2011-02-22 06:31:43 -0800 (Tue, 22 Feb 2011)
New Revision: 11240
Modified:
sandbox/camptocamp/mobile/openlayers/examples/mobile-jq.html
Log:
remove header, update footer
Modified: sandbox/camptocamp/mobile/openlayers/examples/mobile-jq.html
===================================================================
--- sandbox/camptocamp/mobile/openlayers/examples/mobile-jq.html 2011-02-22 14:30:03 UTC (rev 11239)
+++ sandbox/camptocamp/mobile/openlayers/examples/mobile-jq.html 2011-02-22 14:31:43 UTC (rev 11240)
@@ -24,7 +24,7 @@
.ui-content {
padding: 0;
}
- .ui-footer, .ui-header {
+ .ui-footer {
text-align: center;
padding: 5px 0;
}
@@ -40,15 +40,14 @@
</style>
<script>
$(document).ready(function() {
- // fix height of content to allow for header & footer
+ // fix height of content
function fixContentHeight() {
- var header = $("div[data-role='header']:visible");
- var footer = $("div[data-role='footer']:visible");
- var content = $("div[data-role='content']:visible:visible");
- var viewHeight = $(window).height();
+ var footer = $("div[data-role='footer']:visible"),
+ content = $("div[data-role='content']:visible:visible"),
+ viewHeight = $(window).height(),
+ contentHeight = viewHeight - footer.outerHeight();
- var contentHeight = viewHeight - header.outerHeight() - footer.outerHeight();
- if ((content.outerHeight() + header.outerHeight() + footer.outerHeight()) !== viewHeight) {
+ if ((content.outerHeight() + footer.outerHeight()) !== viewHeight) {
contentHeight -= (content.outerHeight() - content.height());
content.height(contentHeight);
}
@@ -61,73 +60,20 @@
}
$(window).bind("orientationchange resize pageshow", fixContentHeight);
fixContentHeight();
-
- // add behavior to navigation buttons
- $("#west").click(function() {
- pan(-0.25, 0);
- });
- $("#north").click(function() {
- pan(0, -0.25);
- });
- $("#south").click(function() {
- pan(0, 0.25);
- });
- $("#east").click(function() {
- pan(0.25, 0);
- });
-
- // add behavior to drawing controls
- function deactivateControls() {
- $.each(map.getControlsByClass(/DrawFeature/), function(index, control) {
- control.deactivate();
- });
- map.getControlsBy("id", "mod-control")[0].deactivate();
- }
- $("#nav, #point, #line, #poly, #mod").change(function(event) {
- deactivateControls();
- // jquery mobile bug regarding change makes us go through all inputs
- // https://github.com/jquery/jquery-mobile/issues/issue/1088
- var val = $("input:radio[name=controls]:checked").val();
- if (val !== "nav") {
- map.getControlsBy("id", val + "-control")[0].activate();
- }
- });
-
- $("#nav").click();
- $("#nav").click(); // jquery mobile bug forces 2 calls to refresh radio ui
-
});
</script>
</head>
<body>
<div data-role="page">
- <div data-role="header">
- <input id="west" type="button" data-icon="arrow-l" value="west">
- <input id="north" type="button" data-icon="arrow-u" value="north">
- <input id="south" type="button" data-icon="arrow-d" value="south">
- <input id="east" type="button" data-icon="arrow-r" value="east">
- </div>
-
<div data-role="content">
<div id="map"></div>
</div>
<div data-role="footer">
- <form id="controls">
- <fieldset data-role="controlgroup" data-type="horizontal" data-role="fieldcontain">
- <input id="nav" type="radio" name="controls" value="nav" checked="checked">
- <label for="nav">navigate</label>
- <input id="point" type="radio" name="controls" value="point">
- <label for="point">point</label>
- <input id="line" type="radio" name="controls" value="line">
- <label for="line">line</label>
- <input id="poly" type="radio" name="controls" value="poly">
- <label for="poly">poly</label>
- <input id="mod" type="radio" name="controls" value="mod">
- <label for="mod">modify</label>
- </fieldset>
- </form>
+ <a href="" data-icon="search" data-role="button">Search</a>
+ <a href="" data-icon="locate" data-role="button">Locate</a>
+ <a href="" data-icon="layers" data-role="button">Layers</a>
</div>
</div>
</body>
More information about the Commits
mailing list