Ignore:
Timestamp:
Jun 21, 2010, 11:20:04 AM (9 years ago)
Author:
duh
Message:
  • improved ontology chooser

-- the button (showHide element) did not hide when a search did not yield results
-- the ontology chooser ignores shortcut form submits by ignoring the ENTER key

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/web-app/js/ontology-chooser.js

    r591 r597  
    6767
    6868    /**
    69      * initialize the ontology autocompleter
     69     * initialize the ontology autocomplete
    7070     * @param element
    7171     */
     
    8080        var target_property = values[2];
    8181        if (ontology_id == "all") { ontology_id = ""; }
     82
     83        // ignore ENTER key in inputElement so the form cannot
     84        // be submitted by pressing the ENTER key
     85        inputElement.bind('keypress', function(e) {
     86            if (e.keyCode == 13) return false;
     87        });
    8288
    8389        // http://bioportal.bioontology.org/search/json_search/?q=musculus
     
    113119                        // hide spinner
    114120                        inputElement.css({ 'background': 'none' });
     121
     122                        // hide button?
     123                        if (!data.data && that.options.showHide) {
     124                            that.options.showHide.hide();   
     125                        }
    115126
    116127                        // response callback
Note: See TracChangeset for help on using the changeset viewer.