]> source.dussan.org Git - nextcloud-server.git/commitdiff
Implement priority on client side in hidden input
authorRobin McCorkell <rmccorkell@karoshi.org.uk>
Thu, 12 Mar 2015 16:27:31 +0000 (16:27 +0000)
committerVincent Petry <pvince81@owncloud.com>
Thu, 12 Mar 2015 17:51:02 +0000 (18:51 +0100)
apps/files_external/js/settings.js
apps/files_external/templates/settings.php

index b3567b7ebf53d8507da23a0fb8d3ef144c0e728e..44488db4bc3122a664bd67de9a957cd413cb531d 100644 (file)
@@ -332,6 +332,13 @@ GlobalStorageConfig.prototype = _.extend({}, StorageConfig.prototype,
         */
        applicableGroups: null,
 
+       /**
+        * Storage priority
+        *
+        * @type int
+        */
+       priority: null,
+
        /**
         * Returns the data from this object
         *
@@ -342,6 +349,7 @@ GlobalStorageConfig.prototype = _.extend({}, StorageConfig.prototype,
                return _.extend(data, {
                        applicableUsers: this.applicableUsers,
                        applicableGroups: this.applicableGroups,
+                       priority: this.priority,
                });
        }
 });
@@ -546,6 +554,8 @@ MountConfigListView.prototype = {
                                        highlightInput(newElement);
                                        $td.append(newElement);
                                });
+                               var priorityEl = $('<input type="hidden" class="priority" value="' + parameters['priority'] + '" />');
+                               $tr.append(priorityEl);
                                if (parameters['custom'] && $el.find('tbody tr.'+backendClass.replace(/\\/g, '\\\\')).length === 1) {
                                        OC.addScript('files_external', parameters['custom']);
                                }
@@ -627,6 +637,8 @@ MountConfigListView.prototype = {
 
                        storage.applicableUsers = users;
                        storage.applicableGroups = groups;
+
+                       storage.priority = $tr.find('input.priority').val();
                }
 
                return storage;
index 5f7d7cff75222e3c5655f8feba9d39d93f355e7c..4c54d4069b2eda1da43e9009bfd354afda92a226 100644 (file)
@@ -90,6 +90,9 @@
                                                                                                        print_unescaped(json_encode($mount['applicable']['users'])); ?>'>
                                        <input type="hidden" class="applicableUsers" style="width:20em;" value=""/>
                                </td>
+                               <?php if (isset($mount['priority'])): ?>
+                               <input type="hidden" class="priority" value="<?php p($mount['priority']) ?>" />
+                               <?php endif; ?>
                                <?php endif; ?>
                                <td <?php if (isset($mount['mountpoint'])): ?>class="remove"
                                        <?php else: ?>style="visibility:hidden;"