X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/9e778a62184d4604f62e6c30fec8d1be1781de4b..e40fdedbc285a0fa6af16e41b5b4f72e46e9987d:/apps/workbench/app/assets/javascripts/editable.js
diff --git a/apps/workbench/app/assets/javascripts/editable.js b/apps/workbench/app/assets/javascripts/editable.js
index a743586942..e6799bf78b 100644
--- a/apps/workbench/app/assets/javascripts/editable.js
+++ b/apps/workbench/app/assets/javascripts/editable.js
@@ -1,6 +1,14 @@
$.fn.editable.defaults.ajaxOptions = {type: 'put', dataType: 'json'};
$.fn.editable.defaults.send = 'always';
+
+// Default for editing is popup. I experimented with inline which is a little
+// nicer in that it shows up right under the mouse instead of nearby. However,
+// the inline box is taller than the regular content, which causes the page
+// layout to shift unless we make the table rows tall, which leaves a lot of
+// wasted space when not editing. Also inline can get cut off if the page is
+// too narrow, when the popup box will just move to do the right thing.
//$.fn.editable.defaults.mode = 'inline';
+
$.fn.editable.defaults.params = function (params) {
var a = {};
var key = params.pk.key;
@@ -9,3 +17,18 @@ $.fn.editable.defaults.params = function (params) {
a[key][params.name] = params.value;
return a;
};
+
+$.fn.editable.defaults.validate = function (value) {
+ if (value == "***invalid***") {
+ return "Invalid selection";
+ }
+}
+
+$.fn.editabletypes.text.defaults.tpl = ''
+
+$.fn.editableform.buttons = '\
+\
+\
+'