Skip to content

Commit

Permalink
Merge pull request #18 from robertgarrigos/catchup
Browse files Browse the repository at this point in the history
catchup with changes on drupal module as of Aug 03, 2018
  • Loading branch information
robertgarrigos authored Aug 12, 2023
2 parents a6e7ae8 + f9aec8c commit aaa32f1
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 5 deletions.
2 changes: 2 additions & 0 deletions js/references-dialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,15 @@
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.
else {
var key_el = $('#' + key);
key_el.val(value);
key_el.change();
key_el.trigger('reference:update')
}
}
return false;
Expand Down
7 changes: 4 additions & 3 deletions js/search-reference.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand All @@ -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.
Expand All @@ -40,7 +41,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;
}
Expand All @@ -55,4 +56,4 @@
})
}
}
})(jQuery);
})(jQuery);
9 changes: 7 additions & 2 deletions references_dialog.module
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit aaa32f1

Please sign in to comment.