From e4326891a13a1bf445635ffbe30fae4e7462b458 Mon Sep 17 00:00:00 2001 From: Daniel Schmitzer Date: Fri, 4 Nov 2016 14:34:21 +0000 Subject: - Arbeiten V4 git-svn-id: https://[internal]/wordpress/plugins/wpsg4@5896 0d5edaf7-2b12-4e95-93f4-047927463d4b --- views/js/admin.js | 47 +++++++++++++++++++++++++++-------------------- views/js/editable.js | 19 ++++++++++++++++++- 2 files changed, 45 insertions(+), 21 deletions(-) (limited to 'views/js') diff --git a/views/js/admin.js b/views/js/admin.js index c7e9276..c0143ce 100644 --- a/views/js/admin.js +++ b/views/js/admin.js @@ -147,27 +147,13 @@ function wpsg_in_array(needle, haystack) } - jQuery(document).ready(function() { - - // Sortierung - jQuery('th.wpsg_order').bind('click', function() { - - var direction = "ASC"; - if (jQuery(this).hasClass('wpsg_order_asc') && jQuery('#wpsg_order').val() == jQuery(this).attr("data-order")) direction = "DESC"; - - jQuery('#wpsg_ascdesc').val(direction); - jQuery('#wpsg_order').val(jQuery(this).attr("data-order")); - - jQuery('#filter_form').submit(); - - return false; - - } ); - + function wpsg_ajaxBind() + { + // Hilfe Tooltips - jQuery('*[data-wpsg-tip]').bind('click', function() { + jQuery('*[data-wpsg-tip]').on('click', function() { - jQuery(this).unbind('click'); + jQuery(this).off('click').on('click', function() { return false; } ); var po = this; @@ -197,7 +183,26 @@ function wpsg_in_array(needle, haystack) return false; } ); - + + } + + jQuery(document).ready(function() { + + // Sortierung + jQuery('th.wpsg_order').bind('click', function() { + + var direction = "ASC"; + if (jQuery(this).hasClass('wpsg_order_asc') && jQuery('#wpsg_order').val() == jQuery(this).attr("data-order")) direction = "DESC"; + + jQuery('#wpsg_ascdesc').val(direction); + jQuery('#wpsg_order').val(jQuery(this).attr("data-order")); + + jQuery('#filter_form').submit(); + + return false; + + } ); + jQuery('.wpsg_showhide_filter').bind('click', function() { if (jQuery(this).hasClass('active')) @@ -216,5 +221,7 @@ function wpsg_in_array(needle, haystack) } } ); + + wpsg_ajaxBind(); } ); diff --git a/views/js/editable.js b/views/js/editable.js index 9717064..353c576 100644 --- a/views/js/editable.js +++ b/views/js/editable.js @@ -47,6 +47,23 @@ opt.value = value; } + else if (options.type == "select" && typeof options.data == "object") + { + + var value = 0; + var strValue = jQuery(this).html(); + + for (var i in options.data) + { + + if (options.data[i] == strValue) value = i; + + } + + opt.source = options.data; + opt.value = value + + } else if (options.type == 'multiarray') { @@ -72,7 +89,7 @@ opt.source = ar; opt.type = 'select'; - } + } else if (options.type == 'string' && typeof options.data == "string") { -- cgit v1.2.3