[js] removed unused and broken SuggestForm Widget (closes #5213487)
authorSamuel Trégouët <samuel.tregouet@logilab.fr>
Fri, 03 Apr 2015 17:59:10 +0200
changeset 10465 5b18e2e4dd71
parent 10464 5ad491852062
child 10466 cf7a1ad9ee42
[js] removed unused and broken SuggestForm Widget (closes #5213487)
web/data/cubicweb.widgets.js
--- a/web/data/cubicweb.widgets.js	Tue Jun 30 15:06:36 2015 +0200
+++ b/web/data/cubicweb.widgets.js	Fri Apr 03 17:59:10 2015 +0200
@@ -347,62 +347,6 @@
 });
 
 /**
- * .. class:: Widgets.SuggestForm
- *
- * suggestform displays a suggest field and associated validate / cancel buttons
- * constructor's argumemts are the same that BaseSuggestField widget
- */
-Widgets.SuggestForm = defclass("SuggestForm", null, {
-
-    __init__: function(inputid, initfunc, varargs, validatefunc, options) {
-        this.validatefunc = validatefunc || $.noop;
-        this.sgfield = new Widgets.BaseSuggestField(inputid, initfunc, varargs, options);
-        this.oklabel = options.oklabel || 'ok';
-        this.cancellabel = options.cancellabel || 'cancel';
-        bindMethods(this);
-        connect(this.sgfield, 'validate', this, this.entryValidated);
-    },
-
-    show: function(parentnode) {
-        var sgnode = this.sgfield.builddom();
-        var buttons = DIV({
-            'class': "sgformbuttons"
-        },
-        [A({
-            'href': "javascript: $.noop();",
-            'onclick': this.onValidateClicked
-        },
-        this.oklabel), ' / ', A({
-            'href': "javascript: $.noop();",
-            'onclick': this.destroy
-        },
-        escapeHTML(this.cancellabel))]);
-        var formnode = DIV({
-            'class': "sgform"
-        },
-        [sgnode, buttons]);
-        appendChildNodes(parentnode, formnode);
-        this.sgfield.textinput.focus();
-        this.formnode = formnode;
-        return formnode;
-    },
-
-    destroy: function() {
-        signal(this, 'destroy');
-        this.sgfield.destroy();
-        removeElement(this.formnode);
-    },
-
-    onValidateClicked: function() {
-        this.validatefunc(this, this.sgfield.taglist());
-    },
-    /* just an indirection to pass the form instead of the sgfield as first parameter */
-    entryValidated: function(sgfield, taglist) {
-        this.validatefunc(this, taglist);
-    }
-});
-
-/**
  * .. function:: toggleTree(event)
  *
  * called when the use clicks on a tree node