Server sync
This commit is contained in:
@@ -192,6 +192,17 @@ function CATC(asGlobals)
|
||||
$Modal.find('.body-title').text(sTitle);
|
||||
});
|
||||
|
||||
//Sync
|
||||
self.elem.$Menu.find('.sync').click(function(){
|
||||
Tools.ajax(
|
||||
'server_push',
|
||||
()=>{self.feedback('success', 'Successful Sync');},
|
||||
{},
|
||||
()=>{self.feedback('error', 'Sync failed');},
|
||||
$(this).find('i')
|
||||
);
|
||||
});
|
||||
|
||||
//Home
|
||||
self.elem.$Menu.find('.home').click(function(){self.setHash(self.consts.default_page);});
|
||||
|
||||
|
||||
@@ -22,14 +22,13 @@ var Tools = {
|
||||
else asData = oData;
|
||||
asData['a'] = sAction;
|
||||
|
||||
if($Loader)
|
||||
{
|
||||
if($Loader) {
|
||||
$Loader
|
||||
.data('load_html', $Loader.html())
|
||||
.data('load_class', $Loader.attr('class'))
|
||||
.removeClassPrefix('fa-')
|
||||
.addClass('loader')
|
||||
.html($('<img>', {'class':'onlyimg', src: Config.paths.dir.theme_image+"ajax.svg"}));
|
||||
.addClass('fa-loading')
|
||||
.html('');
|
||||
}
|
||||
|
||||
if(bBeacon) {
|
||||
@@ -253,6 +252,16 @@ $.fn.toPx = function(settings){
|
||||
return Math.round(that * scopeVal) + 'px';
|
||||
};
|
||||
|
||||
$.fn.removeClassPrefix = function(prefix) {
|
||||
this.each(function(i, el) {
|
||||
var classes = el.className.split(" ").filter(function(c) {
|
||||
return c.lastIndexOf(prefix, 0) !== 0;
|
||||
});
|
||||
el.className = $.trim(classes.join(" "));
|
||||
});
|
||||
return this;
|
||||
};
|
||||
|
||||
function getElem(anchor, path)
|
||||
{
|
||||
return (typeof path == 'object' && path.length > 1)?getElem(anchor[path.shift()], path):anchor[(typeof path == 'object')?path.shift():path];
|
||||
|
||||
Reference in New Issue
Block a user