Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

MDL-39776 Javascript - enable formautosubmit from a select box on and…

…roid
  • Loading branch information...
commit 30bf77467e37f0f08cdbbd6d8c1d261976f88290 1 parent 22084d5
@jsnfwlr jsnfwlr authored
View
4 lib/yui/build/moodle-core-formautosubmit/moodle-core-formautosubmit-debug.js
@@ -36,8 +36,8 @@ Y.extend(FORMAUTOSUBMIT, Y.Base, {
// Macintosh webkit browsers like change events, but non-macintosh webkit browsers don't.
applyto.delegate('change', this.process_changes, 'select.' + CSS.AUTOSUBMIT, this);
}
- if (Y.UA.ios) {
- // IOS doesn't trigger click events because it's touch-based.
+ if ((Y.UA.ios) || (Y.UA.android)) {
+ // IOS and Android don't trigger click events because they are touch-based.
applyto.delegate('change', this.process_changes, 'select.' + CSS.AUTOSUBMIT, this);
}
}
View
2  lib/yui/build/moodle-core-formautosubmit/moodle-core-formautosubmit-min.js
@@ -1 +1 @@
-YUI.add("moodle-core-formautosubmit",function(e,t){var n,r="core-formautosubmit",i,s=!1;n={AUTOSUBMIT:"autosubmit"},i=function(){i.superclass.constructor.apply(this,arguments)},e.extend(i,e.Base,{initializer:function(){var t,r;s||(s=!0,t=e.one("body"),t.delegate("key",this.process_changes,"press:13","select."+n.AUTOSUBMIT,this),t.delegate("click",this.process_changes,"select."+n.AUTOSUBMIT,this),e.UA.os==="macintosh"&&e.UA.webkit&&t.delegate("change",this.process_changes,"select."+n.AUTOSUBMIT,this),e.UA.ios&&t.delegate("change",this.process_changes,"select."+n.AUTOSUBMIT,this)),this.get("selectid")&&(r=e.one("select#"+this.get("selectid")),r&&(this.get("nothing")&&r.setData("nothing",this.get("nothing")),r.setData("startindex",r.get("selectedIndex"))))},check_changed:function(e){var t,r,i,s,o;return t=e.target.ancestor("select."+n.AUTOSUBMIT,!0),t?(r=t.getData("nothing"),i=t.getData("startindex"),s=t.get("selectedIndex"),o=t.getAttribute("data-previousindex"),t.setAttribute("data-previousindex",s),o||(o=i),r!==!1&&t.get("value")===r||i===t.get("selectedIndex")||s===o?!1:t):!1},process_changes:function(e){var t=this.check_changed(e),n;t&&(n=t.ancestor("form",!0),n.submit())}},{NAME:r,ATTRS:{selectid:{value:""},nothing:{value:""},ignorechangeevent:{value:!1}}}),M.core=M.core||{},M.core.init_formautosubmit=M.core.init_formautosubmit||function(e){return new i(e)}},"@VERSION@",{requires:["base","event-key"]});
+YUI.add("moodle-core-formautosubmit",function(e,t){var n,r="core-formautosubmit",i,s=!1;n={AUTOSUBMIT:"autosubmit"},i=function(){i.superclass.constructor.apply(this,arguments)},e.extend(i,e.Base,{initializer:function(){var t,r;s||(s=!0,t=e.one("body"),t.delegate("key",this.process_changes,"press:13","select."+n.AUTOSUBMIT,this),t.delegate("click",this.process_changes,"select."+n.AUTOSUBMIT,this),e.UA.os==="macintosh"&&e.UA.webkit&&t.delegate("change",this.process_changes,"select."+n.AUTOSUBMIT,this),(e.UA.ios||e.UA.android)&&t.delegate("change",this.process_changes,"select."+n.AUTOSUBMIT,this)),this.get("selectid")&&(r=e.one("select#"+this.get("selectid")),r&&(this.get("nothing")&&r.setData("nothing",this.get("nothing")),r.setData("startindex",r.get("selectedIndex"))))},check_changed:function(e){var t,r,i,s,o;return t=e.target.ancestor("select."+n.AUTOSUBMIT,!0),t?(r=t.getData("nothing"),i=t.getData("startindex"),s=t.get("selectedIndex"),o=t.getAttribute("data-previousindex"),t.setAttribute("data-previousindex",s),o||(o=i),r!==!1&&t.get("value")===r||i===t.get("selectedIndex")||s===o?!1:t):!1},process_changes:function(e){var t=this.check_changed(e),n;t&&(n=t.ancestor("form",!0),n.submit())}},{NAME:r,ATTRS:{selectid:{value:""},nothing:{value:""},ignorechangeevent:{value:!1}}}),M.core=M.core||{},M.core.init_formautosubmit=M.core.init_formautosubmit||function(e){return new i(e)}},"@VERSION@",{requires:["base","event-key"]});
View
4 lib/yui/build/moodle-core-formautosubmit/moodle-core-formautosubmit.js
@@ -36,8 +36,8 @@ Y.extend(FORMAUTOSUBMIT, Y.Base, {
// Macintosh webkit browsers like change events, but non-macintosh webkit browsers don't.
applyto.delegate('change', this.process_changes, 'select.' + CSS.AUTOSUBMIT, this);
}
- if (Y.UA.ios) {
- // IOS doesn't trigger click events because it's touch-based.
+ if ((Y.UA.ios) || (Y.UA.android)) {
+ // IOS and Android don't trigger click events because they are touch-based.
applyto.delegate('change', this.process_changes, 'select.' + CSS.AUTOSUBMIT, this);
}
}
View
4 lib/yui/src/formautosubmit/js/formautosubmit.js
@@ -34,8 +34,8 @@ Y.extend(FORMAUTOSUBMIT, Y.Base, {
// Macintosh webkit browsers like change events, but non-macintosh webkit browsers don't.
applyto.delegate('change', this.process_changes, 'select.' + CSS.AUTOSUBMIT, this);
}
- if (Y.UA.ios) {
- // IOS doesn't trigger click events because it's touch-based.
+ if ((Y.UA.ios) || (Y.UA.android)) {
+ // IOS and Android don't trigger click events because they are touch-based.
applyto.delegate('change', this.process_changes, 'select.' + CSS.AUTOSUBMIT, this);
}
}
Please sign in to comment.
Something went wrong with that request. Please try again.