From 9ef1718026a3afdfe51d1db4897d90278a8dcd1f Mon Sep 17 00:00:00 2001 From: robertgarrigos Date: Sat, 12 Aug 2023 12:26:23 +0200 Subject: [PATCH 1/5] catchup with Issue #2805801 by hey_germano, zvse: Sorting on a view created for search on... --- js/search-reference.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/js/search-reference.js b/js/search-reference.js index d9f5fe8..96bb8c8 100644 --- a/js/search-reference.js +++ b/js/search-reference.js @@ -40,7 +40,7 @@ // For links within the Views table, or those with a destination // parameter, open in a new window instead. - if (href.indexOf('destination=') >= 0 || $(element).parents('table.views-table').size() > 0) { + if (href.indexOf('destination=') >= 0 || $(element).parents('table.views-table tbody').size() > 0) { $(element).attr('target', '_blank'); return; } @@ -55,4 +55,4 @@ }) } } -})(jQuery); \ No newline at end of file +})(jQuery); From d4ea476b1b67330b6a6ae80393ea40043105f6b6 Mon Sep 17 00:00:00 2001 From: robertgarrigos Date: Sat, 12 Aug 2023 12:29:04 +0200 Subject: [PATCH 2/5] catchup with Issue #2959542 by zvse: Custom event for the Dialog "field update" --- js/references-dialog.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/js/references-dialog.js b/js/references-dialog.js index a7756ed..e36a3a4 100644 --- a/js/references-dialog.js +++ b/js/references-dialog.js @@ -32,6 +32,7 @@ var target = $('#' + widget_settings.target); target.val(value); target.change(); + target.trigger('reference:update') } // If we have none of the above, we just insert the value in the item // that invoked this. @@ -39,6 +40,7 @@ var key_el = $('#' + key); key_el.val(value); key_el.change(); + key_el.trigger('reference:update') } } return false; From 5d3ee48d3331104efe4e38c0e49f11f950eeeea2 Mon Sep 17 00:00:00 2001 From: robertgarrigos Date: Sat, 12 Aug 2023 12:37:02 +0200 Subject: [PATCH 3/5] catchup with Issue #2959522 by zvse: Process widget only once --- references_dialog.module | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/references_dialog.module b/references_dialog.module index ebaf1ae..f774762 100644 --- a/references_dialog.module +++ b/references_dialog.module @@ -238,8 +238,13 @@ function references_dialog_field_attachable_query($view) { * Return an array of supported widgets. */ function references_dialog_widgets() { - $widgets = module_invoke_all('references_dialog_widgets'); - backdrop_alter('references_dialog_widgets', $widgets); + $widgets = &backdrop_static(__FUNCTION__); + + if ($widgets === NULL) { + $widgets = module_invoke_all('references_dialog_widgets'); + backdrop_alter('references_dialog_widgets', $widgets); + } + return $widgets; } From f9fef0cb38ebac3b5830e640144a698d0b1aac9b Mon Sep 17 00:00:00 2001 From: robertgarrigos Date: Sat, 12 Aug 2023 12:38:40 +0200 Subject: [PATCH 4/5] catchup with Issue #2843292 by Graber: When selecting a reference on popup in IE new window... --- js/search-reference.js | 1 + 1 file changed, 1 insertion(+) diff --git a/js/search-reference.js b/js/search-reference.js index 96bb8c8..0d03b99 100644 --- a/js/search-reference.js +++ b/js/search-reference.js @@ -22,6 +22,7 @@ } selector.each(function(index) { $(this).click(function(e) { + e.preventDefault(); // Ignore if the element is a link. if (e.target && e.target.nodeName && e.target.nodeName.toLowerCase() !== 'a') { // Fetch the entity from wherever it might be. From f9aec8cc5479984bfb9afacad0de44580facbaa2 Mon Sep 17 00:00:00 2001 From: robertgarrigos Date: Sat, 12 Aug 2023 12:41:39 +0200 Subject: [PATCH 5/5] catchup with Issue #2406941 by IRuslan: Wrong referred entity detection for search dialog --- js/search-reference.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/search-reference.js b/js/search-reference.js index 0d03b99..cc8b865 100644 --- a/js/search-reference.js +++ b/js/search-reference.js @@ -9,7 +9,7 @@ // JQuery.each() to freak ut.' var selector = null; if ($('table.views-table').size() > 0) { - selector = $('table.views-table tbody tr'); + selector = $('table.views-table tbody tr:not(.views-table-row-select-all)'); } else if ($('table.views-view-grid').size() > 0) { selector = $('table.views-view-grid td');