Merge branch 'master' into lqc-trunk
[redakcja.git] / platforma / static / js / models.js
index d0e7df1..59a285a 100755 (executable)
@@ -414,6 +414,22 @@ Editor.ImageGalleryModel = Editor.Model.extend({
         this.pages = [];
     },
 
+    setGallery: function(path) {
+      $.ajax({
+          url: this.serverURL,
+          type: 'post',
+          data: {
+              path: path,
+          },
+          success: this.settingGallerySucceeded.bind(this)           
+      });
+    },
+    
+    settingGallerySucceeded: function(data) {
+      console.log('settingGallerySucceeded');
+      this.load(true);
+    },
+    
     load: function(force) {
         if (force || this.get('state') == 'empty') {
             console.log("setting state");