##// END OF EJS Templates
move backbone sync outside the widget manager class
Jonathan Frederic -
Show More
@@ -24,6 +24,13 b''
24 define(["underscore",
24 define(["underscore",
25 "backbone",
25 "backbone",
26 ], function (underscore, backbone) {
26 ], function (underscore, backbone) {
27
28 Backbone.sync = function (method, model, options, error) {
29 var result = model._handle_sync(method, options);
30 if (options.success) {
31 options.success(result);
32 }
33 };
27
34
28 //--------------------------------------------------------------------
35 //--------------------------------------------------------------------
29 // WidgetManager class
36 // WidgetManager class
@@ -34,13 +41,6 b''
34 (target_name) and model types. */
41 (target_name) and model types. */
35 this._view_types = {}; /* Dictionary of view names and view types. */
42 this._view_types = {}; /* Dictionary of view names and view types. */
36 this._models = {}; /* Dictionary of model ids and model instances */
43 this._models = {}; /* Dictionary of model ids and model instances */
37
38 Backbone.sync = function (method, model, options, error) {
39 var result = model._handle_sync(method, options);
40 if (options.success) {
41 options.success(result);
42 }
43 };
44 };
44 };
45
45
46
46
General Comments 0
You need to be logged in to leave comments. Login now