js: Add identifiers to X-Editable templates.
authorBrett Smith <brett@curoverse.com>
Mon, 17 Mar 2014 18:48:02 +0000 (14:48 -0400)
committerBrett Smith <brett@curoverse.com>
Mon, 17 Mar 2014 18:48:02 +0000 (14:48 -0400)
This gives the form elements name and id attributes, as appropriate.
This will make it easier for us to refer to them in integration tests.

apps/workbench/app/assets/javascripts/editable.js

index e37b9444c1615bfd10ce760fa3934f0ab7e76c0d..e6799bf78b40d4a3b3ef0cb4cbcb3c764db82d4d 100644 (file)
@@ -23,3 +23,12 @@ $.fn.editable.defaults.validate = function (value) {
         return "Invalid selection";
     }
 }
+
+$.fn.editabletypes.text.defaults.tpl = '<input type="text" name="editable-text">'
+
+$.fn.editableform.buttons = '\
+<button type="submit" class="btn btn-primary btn-sm editable-submit" \
+  id="editable-submit"><i class="glyphicon glyphicon-ok"></i></button>\
+<button type="button" class="btn btn-default btn-sm editable-cancel" \
+  id="editable-cancel"><i class="glyphicon glyphicon-remove"></i></button>\
+'