refactoring

This commit is contained in:
rolux 2012-05-28 18:21:00 +02:00
parent ab68c4a54f
commit 9ee0742b53
6 changed files with 15 additions and 13 deletions

View file

@ -216,9 +216,9 @@ Ox.Progressbar = function(options, self) {
self.setOption = function(key, value) {
if (key == 'cancelled') {
toggleCancelled();
} if (key == 'paused') {
} else if (key == 'paused') {
togglePaused();
} if (key == 'progress') {
} else if (key == 'progress') {
self.options.progress = Ox.limit(self.options.progress, 0, 1);
!self.options.paused && !self.options.cancelled && setProgress(true);
}

View file

@ -36,6 +36,7 @@ Ox.SyntaxHighlighter = function(options, self) {
tabSize: 4
})
.options(options || {})
.update(renderSource)
.addClass('OxSyntaxHighlighter');
renderSource();
@ -132,10 +133,6 @@ Ox.SyntaxHighlighter = function(options, self) {
}
}
self.setOption = function(key, value) {
renderSource();
};
return that;
};

View file

@ -102,7 +102,7 @@ Ox.FileButton = function(options, self) {
if (key == 'disabled') {
self.$button.options({disabled: value});
self.$input[value ? 'hide' : 'show']();
} else if (key == title) {
} else if (key == 'title') {
self.$button.options({title: value});
}
}

View file

@ -848,7 +848,7 @@ Ox.Input = function(options, self) {
}
self.setOption = function(key, value) {
var inputWidth, val;
var inputWidth;
if (['autocomplete', 'autocompleteReplace', 'autocompleteSelect', 'autovalidate'].indexOf(key) > -1) {
if (self.options.autocomplete && self.options.autocompleteSelect) {
self.$autocompleteMenu = constructAutocompleteMenu();

View file

@ -13,9 +13,9 @@ Ox.MapRectangle = function(options, self) {
var that = this;
options = Ox.extend({
map: null,
place: null
}, options);
map: null,
place: null
}, options);
Ox.forEach(options, function(val, key) {
that[key] = val;

View file

@ -18,6 +18,12 @@ Ox.Tooltip = function(options, self) {
title: ''
})
.options(options || {})
.update({
title: function() {
that.html(value);
value === '' && that.detach();
}
})
.addClass('OxTooltip')
.html(self.options.title);
@ -27,8 +33,7 @@ Ox.Tooltip = function(options, self) {
self.setOption = function(key, value) {
if (key == 'title') {
that.html(value);
value === '' && that.detach();
}
};