Browse files

ForumNG: Replace YUI2 code in module.js [2.4] #5901

  • Loading branch information...
1 parent 57ad849 commit feda242f6b5fce6b0cf9daa72e4834b99487afa2 @jason-platts jason-platts committed with sammarshallou Feb 7, 2013
Showing with 22 additions and 30 deletions.
  1. +21 −29 module.js
  2. +1 −1 version.php
View
50 module.js
@@ -170,10 +170,10 @@ M.mod_forumng = {
// Apply stop indents
this.apply_stop_indents();
- var region = YAHOO.util.Dom.getRegion(document.getElementById('forumng-main'));
+ var region = this.Y.one('#forumng-main').get('region');
this.viewportwidth = region.right - region.left;
setInterval(function() {
- var region = YAHOO.util.Dom.getRegion(document.getElementById('forumng-main'));
+ var region = this.Y.one('#forumng-main').get('region');
var width = region.right - region.left;
if (width != M.mod_forumng.viewportwidth) {
M.mod_forumng.viewportwidth = width;
@@ -849,19 +849,15 @@ M.mod_forumng = {
*/
links_disable: function(root) {
root.linksdisabled = true;
- var commandblocks = YAHOO.util.Dom.getElementsByClassName(
- 'forumng-commands', 'ul', root);
- for (var i=0; i<commandblocks.length; i++) {
- var links = commandblocks[i].getElementsByTagName('a');
- for (var j=0; j<links.length; j++) {
- links[j].oldonclick = links[j].onclick;
- links[j].onclick = function() {
- return false;
- }
- links[j].style.cursor = 'default';
- links[j].tabIndex = -1;
- links[j].className += ' forumng-disabled';
- }
+ var links = M.mod_forumng.Y.all('ul.forumng-commands a').getDOMNodes();
+ for (var j = 0, len = links.length; j < len; j++) {
+ links[j].oldonclick = links[j].onclick;
+ links[j].onclick = function() {
+ return false;
+ };
+ links[j].style.cursor = 'default';
+ links[j].tabIndex = -1;
+ links[j].className += ' forumng-disabled';
}
},
@@ -871,21 +867,17 @@ M.mod_forumng = {
*/
links_enable: function(root) {
root.linksdisabled = false;
- var commandblocks = YAHOO.util.Dom.getElementsByClassName(
- 'forumng-commands', 'ul', root);
- for (var i=0; i<commandblocks.length; i++) {
- var links = commandblocks[i].getElementsByTagName('a');
- for (var j=0; j<links.length; j++) {
- if (links[j].oldonclick) {
- links[j].onclick = links[j].oldonclick;
- links[j].oldonclick = false; // Wanted to do 'delete' but it crashes ie
- } else {
- links[j].onclick = false;
- }
- links[j].style.cursor = 'auto';
- links[j].tabIndex = 0;
- links[j].className = links[j].className.replace(' forumng-disabled', '');
+ var links = M.mod_forumng.Y.all('ul.forumng-commands a').getDOMNodes();
+ for (var j=0, len = links.length; j < len; j++) {
+ if (links[j].oldonclick) {
+ links[j].onclick = links[j].oldonclick;
+ links[j].oldonclick = false; // Wanted to do 'delete' but it crashes ie
+ } else {
+ links[j].onclick = function(){};
}
+ links[j].style.cursor = 'auto';
+ links[j].tabIndex = 0;
+ links[j].className = links[j].className.replace(' forumng-disabled', '');
}
},
View
2 version.php
@@ -22,7 +22,7 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-$module->version = 2013012800;
+$module->version = 2013020700;
$module->requires = 2011120100;
$module->cron = 60;

0 comments on commit feda242

Please sign in to comment.