refactoring
This commit is contained in:
parent
ab68c4a54f
commit
9ee0742b53
6 changed files with 15 additions and 13 deletions
|
@ -216,9 +216,9 @@ Ox.Progressbar = function(options, self) {
|
||||||
self.setOption = function(key, value) {
|
self.setOption = function(key, value) {
|
||||||
if (key == 'cancelled') {
|
if (key == 'cancelled') {
|
||||||
toggleCancelled();
|
toggleCancelled();
|
||||||
} if (key == 'paused') {
|
} else if (key == 'paused') {
|
||||||
togglePaused();
|
togglePaused();
|
||||||
} if (key == 'progress') {
|
} else if (key == 'progress') {
|
||||||
self.options.progress = Ox.limit(self.options.progress, 0, 1);
|
self.options.progress = Ox.limit(self.options.progress, 0, 1);
|
||||||
!self.options.paused && !self.options.cancelled && setProgress(true);
|
!self.options.paused && !self.options.cancelled && setProgress(true);
|
||||||
}
|
}
|
||||||
|
|
|
@ -36,6 +36,7 @@ Ox.SyntaxHighlighter = function(options, self) {
|
||||||
tabSize: 4
|
tabSize: 4
|
||||||
})
|
})
|
||||||
.options(options || {})
|
.options(options || {})
|
||||||
|
.update(renderSource)
|
||||||
.addClass('OxSyntaxHighlighter');
|
.addClass('OxSyntaxHighlighter');
|
||||||
|
|
||||||
renderSource();
|
renderSource();
|
||||||
|
@ -132,10 +133,6 @@ Ox.SyntaxHighlighter = function(options, self) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
self.setOption = function(key, value) {
|
|
||||||
renderSource();
|
|
||||||
};
|
|
||||||
|
|
||||||
return that;
|
return that;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
|
@ -102,7 +102,7 @@ Ox.FileButton = function(options, self) {
|
||||||
if (key == 'disabled') {
|
if (key == 'disabled') {
|
||||||
self.$button.options({disabled: value});
|
self.$button.options({disabled: value});
|
||||||
self.$input[value ? 'hide' : 'show']();
|
self.$input[value ? 'hide' : 'show']();
|
||||||
} else if (key == title) {
|
} else if (key == 'title') {
|
||||||
self.$button.options({title: value});
|
self.$button.options({title: value});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -848,7 +848,7 @@ Ox.Input = function(options, self) {
|
||||||
}
|
}
|
||||||
|
|
||||||
self.setOption = function(key, value) {
|
self.setOption = function(key, value) {
|
||||||
var inputWidth, val;
|
var inputWidth;
|
||||||
if (['autocomplete', 'autocompleteReplace', 'autocompleteSelect', 'autovalidate'].indexOf(key) > -1) {
|
if (['autocomplete', 'autocompleteReplace', 'autocompleteSelect', 'autovalidate'].indexOf(key) > -1) {
|
||||||
if (self.options.autocomplete && self.options.autocompleteSelect) {
|
if (self.options.autocomplete && self.options.autocompleteSelect) {
|
||||||
self.$autocompleteMenu = constructAutocompleteMenu();
|
self.$autocompleteMenu = constructAutocompleteMenu();
|
||||||
|
|
|
@ -18,6 +18,12 @@ Ox.Tooltip = function(options, self) {
|
||||||
title: ''
|
title: ''
|
||||||
})
|
})
|
||||||
.options(options || {})
|
.options(options || {})
|
||||||
|
.update({
|
||||||
|
title: function() {
|
||||||
|
that.html(value);
|
||||||
|
value === '' && that.detach();
|
||||||
|
}
|
||||||
|
})
|
||||||
.addClass('OxTooltip')
|
.addClass('OxTooltip')
|
||||||
.html(self.options.title);
|
.html(self.options.title);
|
||||||
|
|
||||||
|
@ -27,8 +33,7 @@ Ox.Tooltip = function(options, self) {
|
||||||
|
|
||||||
self.setOption = function(key, value) {
|
self.setOption = function(key, value) {
|
||||||
if (key == 'title') {
|
if (key == 'title') {
|
||||||
that.html(value);
|
|
||||||
value === '' && that.detach();
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue