From 632639b62ddad72e31daa62ef21f992299ec0b8e Mon Sep 17 00:00:00 2001 From: Adam Young Date: Mon, 15 Nov 2010 16:41:21 -0500 Subject: action select if exactly one entity is selected, it enables the entity-facet links in the action panel, and sets the pkey in bbq to the pkey of the selected --- install/static/search.js | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'install/static/search.js') diff --git a/install/static/search.js b/install/static/search.js index 040508734..a107209b1 100644 --- a/install/static/search.js +++ b/install/static/search.js @@ -100,6 +100,28 @@ function ipa_search_widget(spec) { return false; }; + that.select_changed = function(){ + var count = 0; + var pkey; + $('input[name=select]:checked', that.tbody).each(function(input){ + count += 1; + pkey = $(this).val(); + }); + if(count == 1){ + $('.action-panel li.entity-facet'). + removeClass('entity-facet-disabled'); + var state = {}; + $('.action-panel input[id=pkey]').val(pkey); + }else{ + $('.action-panel li.entity-facet'). + addClass('entity-facet-disabled'); + $('.action-panel input').val(null); + + } + return false; + } + + that.remove = function(container) { var values = that.get_selected_values(); @@ -199,6 +221,8 @@ function ipa_search_facet(spec) { spec = spec || {}; + spec.display_class = 'search-facet'; + var that = ipa_facet(spec); that.init = spec.init || init; -- cgit