|
@@ -121,6 +121,7 @@ MarkControl.prototype.addNavGroup = function(title, content) {
|
|
|
MarkControl.prototype.initSetting = function(option) {
|
|
|
this.userId = option.userId;
|
|
|
this.settingSyncUrl = option.settingSyncUrl;
|
|
|
+ this.settingSyncing = false;
|
|
|
this.localStore = window.localStorage;
|
|
|
this.setting = {};
|
|
|
|
|
@@ -157,8 +158,16 @@ MarkControl.prototype.updateSetting = function(item) {
|
|
|
this.setting[key] = item[key];
|
|
|
}
|
|
|
this.localSettingSave();
|
|
|
- if (this.syncUrl != undefined) {
|
|
|
-
|
|
|
+ if (this.settingSyncUrl != undefined && this.settingSyncing == false) {
|
|
|
+ this.settingSyncing = true;
|
|
|
+ var self = this;
|
|
|
+ setTimeout(function() {
|
|
|
+ //同步个性化设置
|
|
|
+ $.post(self.settingSyncUrl, {
|
|
|
+ setting: JSON.stringify(self.setting)
|
|
|
+ });
|
|
|
+ self.settingSyncing = false;
|
|
|
+ }, 1000);
|
|
|
}
|
|
|
}
|
|
|
|