# HG changeset patch # User Samuel Trégouët # Date 1428076750 -7200 # Node ID 5b18e2e4dd719303635ee31cd1ccbf49bd70e5fb # Parent 5ad491852062f863d37ed0df3e95229c99bf18e4 [js] removed unused and broken SuggestForm Widget (closes #5213487) diff -r 5ad491852062 -r 5b18e2e4dd71 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