summaryrefslogtreecommitdiff
path: root/ishtar_common/static/js/ishtar.js
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@iggdrasil.net>2018-07-09 20:59:24 +0200
committerÉtienne Loks <etienne.loks@iggdrasil.net>2018-08-13 18:26:03 +0200
commita2e2e57d792c8ad9f1ced7f3807b97635f38c36d (patch)
tree59990ede30849daf44a9323d7e9a18e17d707285 /ishtar_common/static/js/ishtar.js
parentf642961947a1a4fb79e49ff764d93b3f0ab474db (diff)
downloadIshtar-a2e2e57d792c8ad9f1ced7f3807b97635f38c36d.tar.bz2
Ishtar-a2e2e57d792c8ad9f1ced7f3807b97635f38c36d.zip
Save search queries
Diffstat (limited to 'ishtar_common/static/js/ishtar.js')
-rw-r--r--ishtar_common/static/js/ishtar.js14
1 files changed, 14 insertions, 0 deletions
diff --git a/ishtar_common/static/js/ishtar.js b/ishtar_common/static/js/ishtar.js
index 279d43b0e..0df286c26 100644
--- a/ishtar_common/static/js/ishtar.js
+++ b/ishtar_common/static/js/ishtar.js
@@ -30,6 +30,8 @@ function manage_async_link(event){
$.get(url, function(data) {
$(target).html(data);
});
+ var modal_open = $(this).attr('data-modal-open');
+ if (modal_open) $(modal_open).modal('show');
}
/* default function to prevent undefined */
@@ -266,6 +268,7 @@ $(document).ready(function(){
$(".chosen-select").chosen();
$(".clear-search").click(function(){
$(this).parent().parent().children('input').prop("value", "");
+ enable_save();
});
});
@@ -534,9 +537,18 @@ function get_label_from_input(input){
return input.parent().attr('data-alt-name');
}
+var enable_save = function(){
+ if ($(".search-widget input").val()){
+ $("#save-search-button").removeClass('disabled');
+ } else {
+ $("#save-search-button").addClass('disabled');
+ }
+}
+
function clear_search_field(){
$("#id_search_vector").val("");
add_message("-", 'info', "#advanced-search-info", true);
+ enable_save();
}
function update_search_field(){
@@ -595,6 +607,7 @@ function update_search_field(){
} else {
add_message("-", 'info', "#advanced-search-info", true);
}
+ enable_save();
}
var sheet_list = new Array();
@@ -646,3 +659,4 @@ function manage_pinned_search(name, data){
$('#pinned_search_' + name).hide();
}
}
+