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;
['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.
// 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;
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;