mirror of
https://github.com/Hopiu/jquery-mobile.git
synced 2026-03-16 22:10:25 +00:00
Turn off delayedClickEnabled by default for now. We need to work out some kinks.
Modified sv-test-02.html so that you can dynamically turn on/off the delayedClick behavior.
This commit is contained in:
parent
58506aeef4
commit
8351f5496b
2 changed files with 28 additions and 5 deletions
|
|
@ -29,8 +29,8 @@ jQuery.widget( "mobile.scrollview", jQuery.mobile.widget, {
|
|||
showScrollBars: true,
|
||||
|
||||
pagingEnabled: false,
|
||||
delayedClickSelector: "a,input,textarea,select,.ui-btn",
|
||||
delayedClickEnabled: true
|
||||
delayedClickSelector: "a,input,textarea,select,button,.ui-btn",
|
||||
delayedClickEnabled: false
|
||||
},
|
||||
|
||||
_makePositioned: function($ele)
|
||||
|
|
@ -330,7 +330,15 @@ jQuery.widget( "mobile.scrollview", jQuery.mobile.widget, {
|
|||
this._lastMove = 0;
|
||||
this._enableTracking();
|
||||
|
||||
e.preventDefault();
|
||||
// If we're using mouse events, we need to prevent the default
|
||||
// behavior to suppress accidental selection of text, etc. We
|
||||
// can't do this on touch devices because it will disable the
|
||||
// generation of "click" events.
|
||||
//
|
||||
// XXX: We should test if this has an effect on links! - kin
|
||||
|
||||
if (this.options.eventType == "mouse" || this.options.delayedClickEnabled)
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
},
|
||||
|
||||
|
|
|
|||
|
|
@ -46,13 +46,15 @@ $("[data-role=page]").live("pageshow", function(event) {
|
|||
$this.scrollview(opts);
|
||||
}
|
||||
});
|
||||
|
||||
changeDelayFormElementClick();
|
||||
});
|
||||
|
||||
function changeScrollMethod()
|
||||
{
|
||||
var val = $("#s_method").val();
|
||||
var $sv = $("#evtCatcher").scrollview("scrollTo", 0, 0);
|
||||
if (val == "scroll") {
|
||||
if (val === "scroll") {
|
||||
$sv.css("overflow", "scroll");
|
||||
}
|
||||
else {
|
||||
|
|
@ -61,6 +63,11 @@ function changeScrollMethod()
|
|||
$sv.data("scrollview").options.scrollMethod = val;
|
||||
}
|
||||
|
||||
function changeDelayFormElementClick()
|
||||
{
|
||||
$("#evtCatcher").data("scrollview").options.delayedClickEnabled = ($("#s_delay").val() === "yes");
|
||||
}
|
||||
|
||||
var cb_hd_pd,
|
||||
cb_hd_sp,
|
||||
cb_hm_pd,
|
||||
|
|
@ -132,13 +139,21 @@ $(function(){
|
|||
</select>
|
||||
</div>
|
||||
|
||||
<div data-role="fieldcontain">
|
||||
<label for="s_delay" class="select">Delay Form Element Click:</label>
|
||||
<select name="s_delay" id="s_delay" onchange="changeDelayFormElementClick();">
|
||||
<option value="yes">Yes</option>
|
||||
<option value="no" selected="selected">No</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div data-role="fieldcontain">
|
||||
<fieldset data-role="controlgroup">
|
||||
<input type="checkbox" name="cb_hd_pd" id="cb_hd_pd" />
|
||||
<label for="cb_hd_pd">touchstart - Prevent Default</label>
|
||||
<input type="checkbox" name="cb_hd_sp" id="cb_hd_sp" />
|
||||
<label for="cb_hd_sp">touchstart - Stop Propagation</label>
|
||||
<input type="checkbox" name="cb_hm_pd" id="cb_hm_pd" />
|
||||
<input type="checkbox" name="cb_hm_pd" id="cb_hm_pd" checked="checked" />
|
||||
<label for="cb_hm_pd">touchmove - Prevent Default</label>
|
||||
<input type="checkbox" name="cb_hm_sp" id="cb_hm_sp" />
|
||||
<label for="cb_hm_sp">touchmove - Stop Propagation</label>
|
||||
|
|
|
|||
Loading…
Reference in a new issue