Open Media Library
This commit is contained in:
commit
2ee2bc178a
228 changed files with 85988 additions and 0 deletions
63
static/js/loadingIcon.js
Normal file
63
static/js/loadingIcon.js
Normal file
|
|
@ -0,0 +1,63 @@
|
|||
'use strict';
|
||||
|
||||
oml.ui.loadingIcon = function() {
|
||||
|
||||
var self = {},
|
||||
that = Ox.LoadingIcon({
|
||||
tooltip: Ox._('Reload')
|
||||
}, self)
|
||||
.attr({
|
||||
src: Ox.UI.getImageURL('symbolRedo')
|
||||
})
|
||||
.css(getCSS('stop'))
|
||||
.bindEvent({
|
||||
anyclick: function() {
|
||||
oml.$ui.appPanel.reload();
|
||||
}
|
||||
});
|
||||
|
||||
that.superStart = that.start;
|
||||
that.superStop = that.stop;
|
||||
|
||||
that.start = function() {
|
||||
if (!self.loadingInterval) {
|
||||
that.css(getCSS('start'))
|
||||
.attr({
|
||||
src: Ox.UI.getImageURL('symbolLoading')
|
||||
});
|
||||
that.superStart();
|
||||
}
|
||||
};
|
||||
|
||||
that.stop = function() {
|
||||
if (self.loadingInterval) {
|
||||
that.superStop(function() {
|
||||
that.css(getCSS('stop'))
|
||||
.attr({
|
||||
src: Ox.UI.getImageURL('symbolRedo')
|
||||
});
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
that.update = function(requests) {
|
||||
that[requests ? 'start' : 'stop']();
|
||||
};
|
||||
|
||||
function getCSS(action) {
|
||||
return action == 'start' ? {
|
||||
width: '16px',
|
||||
height: '16px',
|
||||
margin: 0,
|
||||
opacity: 0
|
||||
} : {
|
||||
width: '10px',
|
||||
height: '10px',
|
||||
margin: '3px',
|
||||
opacity: 1
|
||||
};
|
||||
}
|
||||
|
||||
return that;
|
||||
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue