Author: croberts Date: 2011-08-15 18:48:01 +0000 (Mon, 15 Aug 2011) New Revision: 4929
Modified: trunk/wooly/resources/mootools.js Log: Changing the hybrid select box from using the annoying href="#" (which requires an extra back button click to go back) to href='' with the onclick handler returning false to avoid page navigation.
Modified: trunk/wooly/resources/mootools.js =================================================================== --- trunk/wooly/resources/mootools.js 2011-08-15 18:08:19 UTC (rev 4928) +++ trunk/wooly/resources/mootools.js 2011-08-15 18:48:01 UTC (rev 4929) @@ -1787,18 +1787,19 @@
for(var i = this.page; i <= this.page + 6 && i <= numpages; i++){ this.controls.grab(new Element('a', {'text': i, - 'href': '#cpcspswdnbd', + 'href': '', 'class': (i == this.page) ? 'selected' : '', 'events': { 'click': function(evt){ this.setpagenum(evt.target.innerHTML); this.fireEvent('rebuild', [list]); // wrapped list + return false; }.bind(this)} }), 'bottom'); }
var nextbtn = new Element('a', {'text':'Next', - 'href':'#cpcspswdnbd'}); + 'href':''}); this.controls.grab(nextbtn); nextbtn.addClass('disabled');
@@ -1807,11 +1808,12 @@ nextbtn.addEvent('click', function(evt){ this.pageup(); this.fireEvent('rebuild'); + return false; }.bind(this)); }
var lastbtn = new Element('a', {'text':'Last', - 'href':'#cpcspswdnbd'}); + 'href':''}); this.controls.grab(lastbtn); lastbtn.addClass('disabled');
@@ -1820,6 +1822,7 @@ lastbtn.addEvent('click', function(evt){ this.pagelast(numpages); this.fireEvent('rebuild'); + return false; }.bind(this)); }
@@ -1931,7 +1934,7 @@ makebtn: function(label, func, prefix){ var li = new Element('li'); var btn = new Element('a', {'html': label, - 'href': '#', + 'href': '', 'events': { // You might have to bind this differently 'click': func.bind(this) @@ -1953,6 +1956,7 @@ }, this.RESETINPUT ); + return false; }, showselected: function(){ this.filter(this.options.datasrc.getChildren(), @@ -1961,6 +1965,7 @@ }, this.RESETINPUT ); + return false; }, showunselected:function(){ this.filter(this.options.datasrc.getChildren(), @@ -1969,6 +1974,7 @@ }, this.RESETINPUT ); + return false; }, selectAll:function(){ this.options.datasrc.getChildren().each( @@ -1978,6 +1984,7 @@ ); this.fireEvent('rebuild', [this.options.datasrc.getChildren()]); this.update(this.options.datasrc.getChildren().length); + return false; }, selectNone:function(){ this.options.datasrc.getChildren().each( @@ -1987,6 +1994,7 @@ ); this.fireEvent('rebuild', [this.options.datasrc.getChildren()]); this.update(0); + return false; },
// list is the list of option dom elements from the select elem @@ -2022,6 +2030,7 @@ ); this.fireEvent('rebuild', [results]); this.update(this.numselected + adds); + return false; },
update: function(numselected){
cumin-developers@lists.fedorahosted.org