Commit 680ec056 authored by Robin McCorkell's avatar Robin McCorkell Committed by Vincent Petry
Browse files

Implement priority on client side in hidden input

parent ce94a998
......@@ -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;
......
......@@ -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;"
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment