Skip to content

Commit

Permalink
Merged from 1.7.
Browse files Browse the repository at this point in the history
  • Loading branch information
vyshane committed Nov 23, 2006
1 parent c80a13c commit d14d739
Showing 1 changed file with 9 additions and 12 deletions.
21 changes: 9 additions & 12 deletions lib/ajax/section_classes.js
Original file line number Diff line number Diff line change
Expand Up @@ -507,6 +507,8 @@ resource_class.prototype.init_resource = function(id, group, config, parentObj)
this.linkContainer = this.getEl().getElementsByTagName('a')[0];

this.commandContainer = null;
this.indentLeftButton = null;
this.indentRightButton = null;
this.viewButton = null;
this.groupButton = null;
this.handle = null;
Expand Down Expand Up @@ -600,12 +602,14 @@ resource_class.prototype.init_buttons = function() {
['class', 'editing_moveleft']]);
YAHOO.util.Event.addListener(button, 'click', this.indent_left, this, true);
commandContainer.appendChild(button);
this.indentLeftButton = button;
}
if (moveRight) {
var button = main.mk_button('a', '/t/right.gif', [['title', main.portal.strings['moveright']],
['class', 'editing_moveright']]);
YAHOO.util.Event.addListener(button, 'click', this.indent_right, this, true);
commandContainer.appendChild(button);
this.indentRightButton = button;
}

// Add edit button back in.
Expand Down Expand Up @@ -659,11 +663,9 @@ resource_class.prototype.indent_left = function() {
// Remove the indent left button as well.
var commandContainer = YAHOO.util.Dom.getElementsByClassName('commands',
'span', this.getEl())[0];

var indentLeftBtn = YAHOO.util.Dom.getElementsByClassName('editing_moveleft',
'a', commandContainer)[0];

commandContainer.removeChild(indentLeftBtn);
commandContainer.removeChild(this.indentLeftButton);
this.indentLeftButton = null;
}
main.connect('POST', 'class=resource&field=indentleft', null, 'id='+this.id);
return true;
Expand Down Expand Up @@ -691,17 +693,12 @@ resource_class.prototype.indent_right = function() {
var commandContainer = YAHOO.util.Dom.getElementsByClassName('commands',
'span', this.getEl())[0];

var indentLeftBtn = YAHOO.util.Dom.getElementsByClassName('editing_moveleft',
'a', commandContainer)[0];

var indentRightBtn = YAHOO.util.Dom.getElementsByClassName('editing_moveright',
'a', commandContainer)[0];

if (!indentLeftBtn) {
if (!this.indentLeftButton) {
var button = main.mk_button('a', '/t/left.gif', [['title', main.portal.strings['moveleft']],
['class', 'editing_moveleft']]);
YAHOO.util.Event.addListener(button, 'click', this.indent_left, this, true);
commandContainer.insertBefore(button, indentRightBtn);
commandContainer.insertBefore(button, this.indentRightButton);
this.indentLeftButton = button;
}
main.connect('POST', 'class=resource&field=indentright', null, 'id='+this.id);
return true;
Expand Down

0 comments on commit d14d739

Please sign in to comment.