[js] removed unused and broken SuggestForm Widget (closes #5213487)

authorSamuel Trégouët <samuel.tregouet@logilab.fr>
changeset5b18e2e4dd71
branchdefault
phasepublic
hiddenno
parent revision#5ad491852062 [test] Fix unittest_i18n to run properly with "pytest -t" (closes #5576169)
child revision#cf7a1ad9ee42 Update hgignore for temporary test databases
files modified by this revision
web/data/cubicweb.widgets.js
# HG changeset patch
# User Samuel Trégouët <samuel.tregouet@logilab.fr>
# Date 1428076750 -7200
# Fri Apr 03 17:59:10 2015 +0200
# Node ID 5b18e2e4dd719303635ee31cd1ccbf49bd70e5fb
# Parent 5ad491852062f863d37ed0df3e95229c99bf18e4
[js] removed unused and broken SuggestForm Widget (closes #5213487)

diff --git a/web/data/cubicweb.widgets.js b/web/data/cubicweb.widgets.js
@@ -345,66 +345,10 @@
1          Widgets.SuggestField.__init__(this, node, options);
2      }
3  });
4 
5  /**
6 - * .. class:: Widgets.SuggestForm
7 - *
8 - * suggestform displays a suggest field and associated validate / cancel buttons
9 - * constructor's argumemts are the same that BaseSuggestField widget
10 - */
11 -Widgets.SuggestForm = defclass("SuggestForm", null, {
12 -
13 -    __init__: function(inputid, initfunc, varargs, validatefunc, options) {
14 -        this.validatefunc = validatefunc || $.noop;
15 -        this.sgfield = new Widgets.BaseSuggestField(inputid, initfunc, varargs, options);
16 -        this.oklabel = options.oklabel || 'ok';
17 -        this.cancellabel = options.cancellabel || 'cancel';
18 -        bindMethods(this);
19 -        connect(this.sgfield, 'validate', this, this.entryValidated);
20 -    },
21 -
22 -    show: function(parentnode) {
23 -        var sgnode = this.sgfield.builddom();
24 -        var buttons = DIV({
25 -            'class': "sgformbuttons"
26 -        },
27 -        [A({
28 -            'href': "javascript: $.noop();",
29 -            'onclick': this.onValidateClicked
30 -        },
31 -        this.oklabel), ' / ', A({
32 -            'href': "javascript: $.noop();",
33 -            'onclick': this.destroy
34 -        },
35 -        escapeHTML(this.cancellabel))]);
36 -        var formnode = DIV({
37 -            'class': "sgform"
38 -        },
39 -        [sgnode, buttons]);
40 -        appendChildNodes(parentnode, formnode);
41 -        this.sgfield.textinput.focus();
42 -        this.formnode = formnode;
43 -        return formnode;
44 -    },
45 -
46 -    destroy: function() {
47 -        signal(this, 'destroy');
48 -        this.sgfield.destroy();
49 -        removeElement(this.formnode);
50 -    },
51 -
52 -    onValidateClicked: function() {
53 -        this.validatefunc(this, this.sgfield.taglist());
54 -    },
55 -    /* just an indirection to pass the form instead of the sgfield as first parameter */
56 -    entryValidated: function(sgfield, taglist) {
57 -        this.validatefunc(this, taglist);
58 -    }
59 -});
60 -
61 -/**
62   * .. function:: toggleTree(event)
63   *
64   * called when the use clicks on a tree node
65   *  - if the node has a `cubicweb:loadurl` attribute, replace the content of the node
66   *    by the url's content.