added sumbit actions on "enter" for text field and dropdowns on the advanced page
authorerickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Wed, 18 Jan 2006 20:59:57 +0000 (20:59 +0000)
committererickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Wed, 18 Jan 2006 20:59:57 +0000 (20:59 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@2748 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/web/opac/common/js/utils.js
Open-ILS/web/opac/skin/default/js/advanced.js

index 7abb917..4a060ce 100644 (file)
@@ -340,4 +340,9 @@ function sortWordsIgnoreCase(a, b) {
 
 
 
-
+function setEnterFunc(node, func) {
+       if(!(node && func)) return;
+       node.onkeydown = function(evt) {
+               if( userPressedEnter(evt)) func();
+       }
+}
index 392194b..1675855 100644 (file)
@@ -5,8 +5,35 @@ attachEvt("common", "run", advInit);
 function advInit() { 
        $('advanced.wizard.contains').focus();
        depthSelInit(); 
+
+       var wiz = [
+               'advanced.wizard.contains',
+               'advanced.wizard.nocontains',
+               'advanced.wizard.exact',
+               'search_type_selector',
+               'advanced.wizard.form_selector' ];
+       for( var node in wiz ) 
+               setEnterFunc( $(wiz[node]), advWizardRun );
+
+       var ref = [
+               'advanced.refined.title_contains',
+               'advanced.refined.author_contains',
+               'advanced.refined.subject_contains',
+               'advanced.refined.series_contains',
+               'advanced.refined.form_selector',
+               'advanced.refined.series_type',
+               'advanced.refined.subject_type',
+               'advanced.refined.author_type',
+               'advanced.refined.title_type' ];
+       for( var i in ref ) 
+               setEnterFunc( $(ref[i]), advRefinedRun );
+
+       setEnterFunc($('opac.advanced.quick.isbn'), advISBNRun );
+       setEnterFunc($('opac.advanced.quick.issn'), advISSNRun );
+       setEnterFunc( $n( $('advanced.marc.tbody'), 'advanced.marc.value'), advMARCRun );
 }
 
+
 function advWizardRun() {
        var contains = $('advanced.wizard.contains').value;
        var nocontains = $('advanced.wizard.nocontains').value;