MDL-35954 javascript: prevent JS from being triggered on select box by clicking on...
authorMark Nelson <markn@moodle.com>
Wed, 21 Nov 2012 08:54:58 +0000 (16:54 +0800)
committerMark Nelson <markn@moodle.com>
Wed, 21 Nov 2012 08:54:58 +0000 (16:54 +0800)
lib/javascript-static.js

index fa0dfc0..9a6d834 100644 (file)
@@ -414,6 +414,7 @@ M.util.init_select_autosubmit = function(Y, formid, selectid, nothing) {
                     if (e.button == 1) {
                         buttonflag = 1;
                     }
+                    paramobject.lastindex = select.get('selectedIndex');
                 };
 
                 var changedown = function(e, paramobject) {
@@ -421,6 +422,7 @@ M.util.init_select_autosubmit = function(Y, formid, selectid, nothing) {
                         if(e.keyCode == 13) {
                             form.submit();
                         }
+                        paramobject.lastindex = select.get('selectedIndex');
                     }
                 }