X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=tools%2Fhtdocs%2Fmkws.js;h=c268c8ecbf07c25521f873e5e2a54d234cdb0c79;hb=3a0a0a1568521adc95c57fd44e1c39c84d809a99;hp=bd122e23ee1cffa1ba4a8258631009217180bc58;hpb=5306decf7b5329212eb4b5aff7dcdb6c37eb95c5;p=mkws-moved-to-github.git diff --git a/tools/htdocs/mkws.js b/tools/htdocs/mkws.js index bd122e2..c268c8e 100644 --- a/tools/htdocs/mkws.js +++ b/tools/htdocs/mkws.js @@ -390,27 +390,6 @@ function team($, teamName) { //////////////////////////////////////////////////////////////////////////////// - // wait until the DOM is ready - function domReady () - { - $('.mkwsSearchForm.mkwsTeam_' + m_teamName).each(function (i, obj) { - debug("adding search-forms for team '" + m_teamName + "'"); - var node = this; - mkws.handle_node_with_team(node, function(tname) { - debug("adding search-form '" + tname + "' for team '" + m_teamName + "'"); - $(node).submit(onFormSubmitEventHandler); - }); - }); - - var node = $('.mkwsSort.mkwsTeam_' + m_teamName); - if (node.length) - node.change(onSelectDdChange); - node = $('.mkwsPerpage.mkwsTeam_' + m_teamName); - if (node.length) - node.change(onSelectDdChange); - } - - // when search button pressed function onFormSubmitEventHandler() { @@ -942,7 +921,21 @@ function team($, teamName) { $(document).ready(function() { mkws.resize_page() }); } - domReady(); + $('.mkwsSearchForm.mkwsTeam_' + m_teamName).each(function (i, obj) { + debug("adding search-forms for team '" + m_teamName + "'"); + var node = this; + mkws.handle_node_with_team(node, function(tname) { + debug("adding search-form '" + tname + "' for team '" + m_teamName + "'"); + $(node).submit(onFormSubmitEventHandler); + }); + }); + + node = $('.mkwsSort.mkwsTeam_' + m_teamName); + if (node.length) + node.change(onSelectDdChange); + node = $('.mkwsPerpage.mkwsTeam_' + m_teamName); + if (node.length) + node.change(onSelectDdChange); // on first page, hide the termlist $(document).ready(function() { $(".mkwsTermlists.mkwsTeam_" + m_teamName).hide(); }); @@ -1116,16 +1109,8 @@ function team($, teamName) { * implement jQuery plugin $.pazpar2({}) */ function _mkws_jquery_plugin ($) { - var debug_level = 1; - function debug (string) { - if (!debug_level) - return; - - if (typeof console === "undefined" || typeof console.log === "undefined") - return; - - console.log("jquery.pazpar2: " + string); + mkws.debug("jquery.pazpar2: " + string); } function init_popup(obj) {