summaryrefslogtreecommitdiff
path: root/ishtar_common/static/js/ishtar.js
diff options
context:
space:
mode:
Diffstat (limited to 'ishtar_common/static/js/ishtar.js')
-rw-r--r--ishtar_common/static/js/ishtar.js39
1 files changed, 25 insertions, 14 deletions
diff --git a/ishtar_common/static/js/ishtar.js b/ishtar_common/static/js/ishtar.js
index 0ac0a4e89..b1a9b61d5 100644
--- a/ishtar_common/static/js/ishtar.js
+++ b/ishtar_common/static/js/ishtar.js
@@ -62,7 +62,8 @@ var shortcut_menu_show_url = '/show-shortcut-menu/'
function init_shortcut_menu(html){
close_wait();
$("#context-menu").html(html);
- $(".chosen-select").chosen();
+ $("#shortcut-menu .chosen-select").chosen();
+ $("#shortcut-menu .chosen-container").css('width', '100%');
if (advanced_menu) {
init_advanced_shortcut_fields();
} else {
@@ -70,14 +71,16 @@ function init_shortcut_menu(html){
}
$("#short-menu-advanced").click(function(){
$.get(url_path + activate_advanced_url,
- load_shortcut_menu
+ load_opened_shortcut_menu
);
});
$("#short-menu-simple").click(function(){
$.get(url_path + activate_simple_url,
- load_shortcut_menu
+ load_opened_shortcut_menu
);
});
+
+ /*
$(".short-menu-close").click(function(){
$('#shortcut-menu div').hide();
$('#shortcut-menu table').hide();
@@ -98,43 +101,44 @@ function init_shortcut_menu(html){
$(".short-menu-close").hide();
$(".short-menu-open").show();
}
+ */
}
function init_shortcut_fields(){
$("#current_file").change(function(){
$.post('/' + url_path + 'update-current-item/',
{item:'file', value:$("#current_file").val()},
- load_shortcut_menu
+ load_opened_shortcut_menu
);
});
$("#current_operation").change(function(){
$.post('/' + url_path + 'update-current-item/',
{item:'operation', value:$("#current_operation").val()},
- load_shortcut_menu
+ load_opened_shortcut_menu
);
});
$("#current_contextrecord").change(function(){
$.post('/' + url_path + 'update-current-item/',
{item:'contextrecord', value:$("#current_contextrecord").val()},
- load_shortcut_menu
+ load_opened_shortcut_menu
);
});
$("#current_find").change(function(){
$.post('/' + url_path + 'update-current-item/',
{item:'find', value:$("#current_find").val()},
- load_shortcut_menu
+ load_opened_shortcut_menu
);
});
$("#current_treatment").change(function(){
$.post('/' + url_path + 'update-current-item/',
{item:'treatment', value:$("#current_treatment").val()},
- load_shortcut_menu
+ load_opened_shortcut_menu
);
});
$("#current_treatmentfile").change(function(){
$.post('/' + url_path + 'update-current-item/',
{item:'treatmentfile', value:$("#current_treatmentfile").val()},
- load_shortcut_menu
+ load_opened_shortcut_menu
);
});
}
@@ -145,7 +149,7 @@ function init_advanced_shortcut_fields(){
'title', $('#id_select_file-shortcut').val());
$.post('/' + url_path + 'update-current-item/',
{item: "file", value:$("#id_file-shortcut").val()},
- load_shortcut_menu
+ load_opened_shortcut_menu
);
});
$('#id_operation-shortcut').change(function(){
@@ -153,7 +157,7 @@ function init_advanced_shortcut_fields(){
'title', $('#id_select_operation-shortcut').val());
$.post('/' + url_path + 'update-current-item/',
{item: "operation", value:$("#id_operation-shortcut").val()},
- load_shortcut_menu
+ load_opened_shortcut_menu
);
});
$('#id_contextrecord-shortcut').change(function(){
@@ -161,7 +165,7 @@ function init_advanced_shortcut_fields(){
'title', $('#id_select_contextrecord-shortcut').val());
$.post('/' + url_path + 'update-current-item/',
{item: "contextrecord", value:$("#id_contextrecord-shortcut").val()},
- load_shortcut_menu
+ load_opened_shortcut_menu
);
});
$('#id_find-shortcut').change(function(){
@@ -169,7 +173,7 @@ function init_advanced_shortcut_fields(){
'title', $('#id_select_find-shortcut').val());
$.post('/' + url_path + 'update-current-item/',
{item: "find", value:$("#id_find-shortcut").val()},
- load_shortcut_menu
+ load_opened_shortcut_menu
);
});
}
@@ -185,7 +189,11 @@ function display_info(msg){
}, 5000);
}
-function load_shortcut_menu(){
+function load_opened_shortcut_menu(){
+ load_shortcut_menu(true);
+}
+
+function load_shortcut_menu(opened){
if (!shortcut_url) return;
$('.modal-progress').modal('show');
$.ajax({
@@ -193,6 +201,9 @@ function load_shortcut_menu(){
cache: false,
success:function(html){
init_shortcut_menu(html);
+ if(opened){
+ $("#dropdown-toggle-shortcut-menu").click();
+ }
},
error:function(XMLHttpRequest, textStatus, errorThrows){
close_wait();