mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
Merged 3.1 to HEAD
13275: updated web-client to use tinymce v3 13276: overlay display fix for when field has large content git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@13585 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
99
source/web/scripts/tiny_mce/classes/ui/SplitButton.js
vendored
Executable file
99
source/web/scripts/tiny_mce/classes/ui/SplitButton.js
vendored
Executable file
@@ -0,0 +1,99 @@
|
||||
/**
|
||||
* $Id: SplitButton.js 760 2008-04-01 14:13:07Z spocke $
|
||||
*
|
||||
* @author Moxiecode
|
||||
* @copyright Copyright <20> 2004-2008, Moxiecode Systems AB, All rights reserved.
|
||||
*/
|
||||
|
||||
(function() {
|
||||
var DOM = tinymce.DOM, Event = tinymce.dom.Event, each = tinymce.each;
|
||||
|
||||
/**#@+
|
||||
* @class This class is used to create a split button. A button with a menu attached to it.
|
||||
* @member tinymce.ui.SplitButton
|
||||
* @base tinymce.ui.Button
|
||||
*/
|
||||
tinymce.create('tinymce.ui.SplitButton:tinymce.ui.MenuButton', {
|
||||
/**
|
||||
* Constructs a new split button control instance.
|
||||
*
|
||||
* @param {String} id Control id for the split button.
|
||||
* @param {Object} s Optional name/value settings object.
|
||||
*/
|
||||
SplitButton : function(id, s) {
|
||||
this.parent(id, s);
|
||||
this.classPrefix = 'mceSplitButton';
|
||||
},
|
||||
|
||||
/**#@+
|
||||
* @method
|
||||
*/
|
||||
|
||||
/**
|
||||
* Renders the split button as a HTML string. This method is much faster than using the DOM and when
|
||||
* creating a whole toolbar with buttons it does make a lot of difference.
|
||||
*
|
||||
* @return {String} HTML for the split button control element.
|
||||
*/
|
||||
renderHTML : function() {
|
||||
var h, t = this, s = t.settings, h1;
|
||||
|
||||
h = '<tbody><tr>';
|
||||
|
||||
if (s.image)
|
||||
h1 = DOM.createHTML('img ', {src : s.image, 'class' : 'mceAction ' + s['class']});
|
||||
else
|
||||
h1 = DOM.createHTML('span', {'class' : 'mceAction ' + s['class']}, '');
|
||||
|
||||
h += '<td>' + DOM.createHTML('a', {id : t.id + '_action', href : 'javascript:;', 'class' : 'mceAction ' + s['class'], onclick : "return false;", onmousedown : 'return false;', title : s.title}, h1) + '</td>';
|
||||
|
||||
h1 = DOM.createHTML('span', {'class' : 'mceOpen ' + s['class']});
|
||||
h += '<td>' + DOM.createHTML('a', {id : t.id + '_open', href : 'javascript:;', 'class' : 'mceOpen ' + s['class'], onclick : "return false;", onmousedown : 'return false;', title : s.title}, h1) + '</td>';
|
||||
|
||||
h += '</tr></tbody>';
|
||||
|
||||
return DOM.createHTML('table', {id : t.id, 'class' : 'mceSplitButton mceSplitButtonEnabled ' + s['class'], cellpadding : '0', cellspacing : '0', onmousedown : 'return false;', title : s.title}, h);
|
||||
},
|
||||
|
||||
/**
|
||||
* Post render handler. This function will be called after the UI has been
|
||||
* rendered so that events can be added.
|
||||
*/
|
||||
postRender : function() {
|
||||
var t = this, s = t.settings;
|
||||
|
||||
if (s.onclick) {
|
||||
Event.add(t.id + '_action', 'click', function() {
|
||||
if (!t.isDisabled())
|
||||
s.onclick(t.value);
|
||||
});
|
||||
}
|
||||
|
||||
Event.add(t.id + '_open', 'click', t.showMenu, t);
|
||||
Event.add(t.id + '_open', 'focus', function() {t._focused = 1;});
|
||||
Event.add(t.id + '_open', 'blur', function() {t._focused = 0;});
|
||||
|
||||
// Old IE doesn't have hover on all elements
|
||||
if (tinymce.isIE6 || !DOM.boxModel) {
|
||||
Event.add(t.id, 'mouseover', function() {
|
||||
if (!DOM.hasClass(t.id, 'mceSplitButtonDisabled'))
|
||||
DOM.addClass(t.id, 'mceSplitButtonHover');
|
||||
});
|
||||
|
||||
Event.add(t.id, 'mouseout', function() {
|
||||
if (!DOM.hasClass(t.id, 'mceSplitButtonDisabled'))
|
||||
DOM.removeClass(t.id, 'mceSplitButtonHover');
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
destroy : function() {
|
||||
this.parent();
|
||||
|
||||
Event.clear(this.id + '_action');
|
||||
Event.clear(this.id + '_open');
|
||||
}
|
||||
|
||||
/**#@-*/
|
||||
});
|
||||
})();
|
Reference in New Issue
Block a user