toggleHighlight: function(toogle) {
this._container().toggleClass('highlighted-element');
+ },
+
+ toggle: function(toggle) {
+ var mng = this.data('_wlxmlManager');
+ if(mng) {
+ mng.toggle(toggle);
+ }
}
});
this.el.clearWidgets();
this.el.addWidget(widgets.labelWidget(this.el.tag(), this.el.klass()));
+ },
+ toggle: function(toggle) {
+ this.el.toggle(toggle);
}
+
})
var managers = {
this.el.clearWidgets();
var clickHandler = function() {
- this._toggleFootnote(true);
+ this.toggle(true);
}.bind(this);
this.footnoteHandler = widgets.footnoteHandler(clickHandler);
this.el.addWidget(this.footnoteHandler);
var closeHandler = function() {
- this._toggleFootnote(false);
+ this.toggle(false);
}.bind(this);
this.hideButton = widgets.hideButton(closeHandler);
this.el.addWidget(this.hideButton);
- this._toggleFootnote(false);
+ this.toggle(false);
},
- _toggleFootnote: function(toggle) {
+ toggle: function(toggle) {
this.hideButton.toggle(toggle);
this.footnoteHandler.toggle(!toggle);
}
});
+commands.register('footnote', function(canvas, params) {
+ var position = canvas.getCursor().getPosition();
+
+ var asideElement = position.element.divide({tag: 'aside', klass: 'footnote', offset: position.offset});
+
+ asideElement.append({text: ''});
+ asideElement.toggle(true);
+ canvas.setCurrentElement(asideElement);
+});
+
return {
run: function(name, params, canvas) {
<button data-name="list" data-btn-type="toggle" data-meta="bullets" class="btn btn-mini"><i class="icon-list"></i></button>
<button data-name="createList" data-btn-type="cmd" data-meta="enum" class="btn btn-mini"><i class="icon-th-list"></i></button>
</div>
+ <div class="rng-module-documentToolbar-toolbarGroup">
+ <button data-name="footnote" data-btn-type="cmd" class="btn btn-mini"><i class="icon-comment"></i></button>
+ </div>
<div class="rng-module-documentToolbar-toolbarGroup">
<button data-name="grid" data-btn-type="toggle" class="btn btn-mini"><i class="icon-th-large"></i></button>
</div>