extract Options mootools class

This commit is contained in:
Ezequiel Bergamaschi 2014-05-13 02:22:59 -03:00
parent 4b3a00f2e8
commit 597205751e
3 changed files with 15 additions and 2 deletions

View File

@ -0,0 +1,13 @@
mindplot.Options = new Class({
setOptions: function(){
var options = this.options = Object.merge.apply(null, [{}, this.options].append(arguments));
if (this.addEvent) for (var option in options){
if (typeOf(options[option]) != 'function' || !(/^on[A-Z]/).test(option)) continue;
this.addEvent(option, options[option]);
delete options[option];
}
return this;
}
});

View File

@ -1,5 +1,5 @@
var BootstrapDialog = new Class({
Implements: Options,
Implements: mindplot.Options,
options: {
cancelButton: false,

View File

@ -17,7 +17,7 @@
*/
mindplot.widget.FloatingTip = new Class({
Implements: [Options, mindplot.Events],
Implements: [mindplot.Options, mindplot.Events],
options: {
animation: true,