Fix coding style in web/ui_utils.js
This commit is contained in:
parent
af4e977848
commit
0bd865b329
@ -24,10 +24,9 @@ var CustomStyle = (function CustomStyleClosure() {
|
|||||||
// in some versions of IE9 it is critical that ms appear in this list
|
// in some versions of IE9 it is critical that ms appear in this list
|
||||||
// before Moz
|
// before Moz
|
||||||
var prefixes = ['ms', 'Moz', 'Webkit', 'O'];
|
var prefixes = ['ms', 'Moz', 'Webkit', 'O'];
|
||||||
var _cache = { };
|
var _cache = {};
|
||||||
|
|
||||||
function CustomStyle() {
|
function CustomStyle() {}
|
||||||
}
|
|
||||||
|
|
||||||
CustomStyle.getProp = function get(propName, element) {
|
CustomStyle.getProp = function get(propName, element) {
|
||||||
// check cache only when no element is given
|
// check cache only when no element is given
|
||||||
@ -60,8 +59,9 @@ var CustomStyle = (function CustomStyleClosure() {
|
|||||||
|
|
||||||
CustomStyle.setProp = function set(propName, element, str) {
|
CustomStyle.setProp = function set(propName, element, str) {
|
||||||
var prop = this.getProp(propName);
|
var prop = this.getProp(propName);
|
||||||
if (prop != 'undefined')
|
if (prop != 'undefined') {
|
||||||
element.style[prop] = str;
|
element.style[prop] = str;
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
return CustomStyle;
|
return CustomStyle;
|
||||||
@ -247,11 +247,13 @@ var Cache = function cacheCache(size) {
|
|||||||
var data = [];
|
var data = [];
|
||||||
this.push = function cachePush(view) {
|
this.push = function cachePush(view) {
|
||||||
var i = data.indexOf(view);
|
var i = data.indexOf(view);
|
||||||
if (i >= 0)
|
if (i >= 0) {
|
||||||
data.splice(i);
|
data.splice(i);
|
||||||
|
}
|
||||||
data.push(view);
|
data.push(view);
|
||||||
if (data.length > size)
|
if (data.length > size) {
|
||||||
data.shift().destroy();
|
data.shift().destroy();
|
||||||
|
}
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user