comparison src/DML/MainVisBundle/Resources/assets/marionette/modules/ContextModule/ContextModule.20-StateBookmark.js @ 0:493bcb69166c

added public content
author Daniel Wolff
date Tue, 09 Feb 2016 20:54:02 +0100
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:493bcb69166c
1 "use strict";
2
3 App.module("ContextModule", function(ContextModule, App, Backbone, Marionette, $, _, Logger) {
4
5 // Define private variables
6 var logger = null;
7
8 ContextModule.addInitializer(function(options){
9
10 // logger = Logger.get("ContextModule.StateBookmark");
11 // logger.setLevel(Logger.DEBUG);
12
13 /**
14 * StateBookmark contains a named serialized state
15 */
16 ContextModule.StateBookmark = Backbone.Model.extend({
17 defaults: {
18 name: null,
19 time: null,
20 serializedState: null,
21 comment: null,
22 },
23
24 /**
25 * @memberOf App.ContextModule.StateBookmark
26 */
27 initialize: function() {
28 },
29
30 serialize: function() {
31 logger.debug("method called: State::serialize");
32
33 var result = _.clone(this.attributes);
34
35 return result;
36 },
37
38 unserialize: function(serializedAttributes) {
39 this.clear({silent: true}).set(serializedAttributes);
40 },
41 });
42
43 });
44 }, Logger);