Lines 126-134
$( document ).ready( function() {
Link Here
|
126 |
|
126 |
|
127 |
$( "#resultst" ).on("click", ".chosen", function(e) { |
127 |
$( "#resultst" ).on("click", ".chosen", function(e) { |
128 |
e.preventDefault(); |
128 |
e.preventDefault(); |
129 |
var title = $(this).attr('title'); |
129 |
var action = $(this).data('action'); |
130 |
ChangeLastAction( title, 0 ); |
130 |
ChangeLastAction( action, 0 ); |
131 |
if( title == 'Order' ) window.location = $(this).attr('href'); |
131 |
if( action == 'order' ) window.location = $(this).attr('href'); |
132 |
else { |
132 |
else { |
133 |
opener.document.location = $(this).attr('href'); |
133 |
opener.document.location = $(this).attr('href'); |
134 |
window.close(); |
134 |
window.close(); |
Lines 140-154
function InitLastAction() {
Link Here
|
140 |
if( $("#resultst").length == 0 ) return; |
140 |
if( $("#resultst").length == 0 ) return; |
141 |
try { last_action = localStorage.getItem('z3950search_last_action'); } catch (err) {} |
141 |
try { last_action = localStorage.getItem('z3950search_last_action'); } catch (err) {} |
142 |
if( last_action ) { |
142 |
if( last_action ) { |
143 |
var linkcount = $(".z3950actions:eq(0)").siblings(".dropdown-menu").find("a[title='"+last_action+"']").length; |
143 |
var z3950_action_li = $(".z3950actions:eq(0)").siblings(".dropdown-menu").find("a[data-action='"+last_action+"']"); |
144 |
if( linkcount == 0 ) return; |
144 |
if( z3950_action_li.length == 0 ) return; |
145 |
if( last_action != 'MARC' ) $( ".z3950actions" ).text( last_action ); |
145 |
if( last_action != 'show_marc' ) { |
|
|
146 |
$( ".z3950actions" ).text($(z3950_action_li).text()).data('action', last_action); |
147 |
} |
146 |
} |
148 |
} |
147 |
} |
149 |
} |
148 |
|
150 |
|
149 |
function ChangeLastAction(title, change_text) { |
151 |
function ChangeLastAction(action, change_text) { |
150 |
if( last_action && last_action == title ) return; |
152 |
if( last_action && last_action == action ) return; |
151 |
last_action = title; |
153 |
last_action = action; |
152 |
if( change_text ) $( ".z3950actions" ).text( last_action ); |
154 |
if( change_text ) $( ".z3950actions" ).text( last_action ); |
153 |
if( previewed == 0 || change_text == 1 ) |
155 |
if( previewed == 0 || change_text == 1 ) |
154 |
try { localStorage.setItem('z3950search_last_action', last_action); } catch(err) {} |
156 |
try { localStorage.setItem('z3950search_last_action', last_action); } catch(err) {} |
155 |
- |
|
|