diff options
Diffstat (limited to 'ishtar_common/static/js/ishtar.js')
| -rw-r--r-- | ishtar_common/static/js/ishtar.js | 39 | 
1 files changed, 31 insertions, 8 deletions
| diff --git a/ishtar_common/static/js/ishtar.js b/ishtar_common/static/js/ishtar.js index 318c17315..31621502d 100644 --- a/ishtar_common/static/js/ishtar.js +++ b/ishtar_common/static/js/ishtar.js @@ -37,6 +37,18 @@ function get_next_table_id(){}  function get_previous_table_id(){}  var shortcut_url = ''; +var datatables_i18n; + +var datatables_default = { +    "processing": true, +    "serverSide": true, +    "scrollX": true, +    "scrollY": true, +    "searching": false, +    "info": false, +    "scrollCollapse": true +}; +  var advanced_menu = false;  var shortcut_menu_hide = false;  var activate_all_search_url = '/activate-all-search/'; @@ -48,7 +60,7 @@ var shortcut_menu_show_url = '/show-shortcut-menu/'  function init_shortcut_menu(html){      $("#progress").hide(); -    $("#context_menu").html(html); +    $("#context-menu").html(html);      $(".chosen-select").chosen();      if (advanced_menu) {          init_advanced_shortcut_fields(); @@ -195,13 +207,12 @@ $(document).ready(function(){          $('#to_bottom_arrow').hide();          $('#to_top_arrow').hide();      } -    $('#language_selector').change(function(){ -        $('#language_form').submit(); +    $('#language-selector a').click(function(){ +        $('#language-selector input[name="language"]').val( +            $(this).attr("data-lang")); +        $('#language-form').submit();      });      load_shortcut_menu(); -    if ($.isFunction($(".prettyPhoto a").prettyPhoto)){ -        $(".prettyPhoto a").prettyPhoto({'social_tools':''}); -    }      $('#current_items select').change(function(){          $(this).attr('class', $(this).children("option:selected").attr('class'));      }); @@ -271,9 +282,21 @@ function load_window(url, speed, on_success){          cache: false,          success:function(html){              $("#progress").hide(); -            $("#window").append(html); +            $(".previous_page").remove(); +            $(".next_page").remove(); +            var register_id = $(html).find(".card-header").attr("data-sheet-id"); +            var current_sheet = $('[data-sheet-id="' + register_id + '"]'); +            if (current_sheet.length){ +                $(".collapse").removeClass('show'); +                current_sheet.parent().find('.collapse').addClass('show'); +            } else { +                $("#window").append(html); +            }              $("#"+last_window).show(); -            $("a[rel^='prettyPhoto']").prettyPhoto({'social_tools':''}); +            // jump to this window +            var url = location.href; +            location.href = "#" + last_window; +            history.replaceState(null, null, url);              if (on_success) on_success();          },          error:function(XMLHttpRequest, textStatus, errorThrows){ | 
