Skip to content
Snippets Groups Projects

Resolve #3289816 "Automated drupal 10"

5 files
+ 9
9
Compare changes
  • Side-by-side
  • Inline
Files
5
+ 4
4
@@ -2,7 +2,7 @@
* @file
*/
(function ($, Drupal) {
(function ($, Drupal, once) {
Drupal.AjaxCommands.prototype.previewContent = function (ajax, response, status) {
if (response.args && response.args.url) {
if (!$('#live-preview').length) {
@@ -27,7 +27,7 @@ Drupal.AjaxCommands.prototype.previewContent = function (ajax, response, status)
}
// Live preview close event.
$('#live-preview-btn-close').once().on('click', function() {
$(once('live-preview-btn-close', '#live-preview-btn-close')).on('click', function() {
$('#live-preview').animate({
transform: 'translate(100%, 0)'
}, 'slow', 'linear', function() {
@@ -38,7 +38,7 @@ Drupal.AjaxCommands.prototype.previewContent = function (ajax, response, status)
})
// Live preview close fullscreen.
$('#live-preview-btn-fullscreen').once().on('click', function() {
$(once('live-preview-btn-fullscreen', '#live-preview-btn-fullscreen')).on('click', function() {
let el = $(this);
el.text(function() {
return (el.text() == "Fullscreen") ? "Exit Fullscreen" : "Fullscreen";
@@ -47,4 +47,4 @@ Drupal.AjaxCommands.prototype.previewContent = function (ajax, response, status)
});
}
}
})(jQuery, Drupal);
})(jQuery, Drupal, once);
Loading