|
|
@ -14,6 +14,7 @@ define(['json.sortify'], function (Sortify) {
|
|
|
|
var metadataLazyObj = UNINIT;
|
|
|
|
var metadataLazyObj = UNINIT;
|
|
|
|
var priv = {};
|
|
|
|
var priv = {};
|
|
|
|
var dirty = true;
|
|
|
|
var dirty = true;
|
|
|
|
|
|
|
|
var history = false;
|
|
|
|
var changeHandlers = [];
|
|
|
|
var changeHandlers = [];
|
|
|
|
var lazyChangeHandlers = [];
|
|
|
|
var lazyChangeHandlers = [];
|
|
|
|
var titleChangeHandlers = [];
|
|
|
|
var titleChangeHandlers = [];
|
|
|
@ -60,7 +61,7 @@ define(['json.sortify'], function (Sortify) {
|
|
|
|
var mdo = {};
|
|
|
|
var mdo = {};
|
|
|
|
// We don't want to add our user data to the object multiple times.
|
|
|
|
// We don't want to add our user data to the object multiple times.
|
|
|
|
Object.keys(metadataObj.users).forEach(function (x) {
|
|
|
|
Object.keys(metadataObj.users).forEach(function (x) {
|
|
|
|
if (members.indexOf(x) === -1) { return; }
|
|
|
|
if (members.indexOf(x) === -1 && !history) { return; }
|
|
|
|
mdo[x] = metadataObj.users[x];
|
|
|
|
mdo[x] = metadataObj.users[x];
|
|
|
|
});
|
|
|
|
});
|
|
|
|
if (!priv.readOnly) {
|
|
|
|
if (!priv.readOnly) {
|
|
|
@ -161,6 +162,9 @@ define(['json.sortify'], function (Sortify) {
|
|
|
|
metadataLazyObj = JSON.parse(JSON.stringify(m));
|
|
|
|
metadataLazyObj = JSON.parse(JSON.stringify(m));
|
|
|
|
change(false);
|
|
|
|
change(false);
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
refresh : function () {
|
|
|
|
|
|
|
|
change(true);
|
|
|
|
|
|
|
|
},
|
|
|
|
updateTitle: function (t) {
|
|
|
|
updateTitle: function (t) {
|
|
|
|
metadataObj.title = t;
|
|
|
|
metadataObj.title = t;
|
|
|
|
change(true);
|
|
|
|
change(true);
|
|
|
@ -207,6 +211,9 @@ define(['json.sortify'], function (Sortify) {
|
|
|
|
if (isReady) { return void f(); }
|
|
|
|
if (isReady) { return void f(); }
|
|
|
|
readyHandlers.push(f);
|
|
|
|
readyHandlers.push(f);
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
setHistory: function (bool) {
|
|
|
|
|
|
|
|
history = bool;
|
|
|
|
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
};
|
|
|
|
};
|
|
|
|
return Object.freeze({ create: create });
|
|
|
|
return Object.freeze({ create: create });
|
|
|
|