Commit 42915cdd authored by Samuel Mortenson's avatar Samuel Mortenson Committed by Sam Mortenson
Browse files

Issue #3287553 by Project Update Bot, samuel.mortenson: Automated Drupal 10 compatibility fixes

parent 76cc7159
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -276,6 +276,11 @@ input.entity-browser-show-selection {
  transition: opacity .2s;
}

.file-browser-preview-button:hover,
.file-browser-preview-button:focus {
  color: transparent;
}

.file-browser-preview-button + .ajax-progress {
  display: none;
}
+1 −1
Original line number Diff line number Diff line
@@ -18,7 +18,7 @@ function file_browser_install() {
  if (!\Drupal::isConfigSyncing()) {
    $data = file_get_contents(dirname(__FILE__) . '/file_browser_icon.png');
    /** @var \Drupal\file\FileInterface $file */
    $file = file_save_data($data, 'public://file_browser_icon.png', FileSystemInterface::EXISTS_REPLACE);
    $file = \Drupal::service('file.repository')->writeData($data, 'public://file_browser_icon.png', FileSystemInterface::EXISTS_REPLACE);
    if ($file) {
      // Set file uuid same as default config.
      $uuid = Yaml::decode(file_get_contents(dirname(__FILE__) . '/config/install/embed.button.file_browser.yml'))['icon_uuid'];
+2 −2
Original line number Diff line number Diff line
@@ -20,7 +20,7 @@ view:
  dependencies:
    - core/jquery
    - core/drupal
    - core/jquery.once
    - core/once
    - file_browser/imagesloaded
    - file_browser/masonry

@@ -34,7 +34,7 @@ preview:
  dependencies:
    - core/jquery
    - core/drupal
    - core/jquery.once
    - core/once

imagesloaded:
  remote: https://github.com/desandro/imagesloaded
+3 −3
Original line number Diff line number Diff line
@@ -12,9 +12,9 @@
   */
  Drupal.behaviors.fileBrowserPreview = {
    attach: function (context, settings) {
      var $wrapper = $('#file-browser-preview-wrapper').once('file-browser-preview');
      if ($wrapper.length) {
        $wrapper.find('select').on('change', function () {
      var wrapper = once('file-browser-preview', '#file-browser-preview-wrapper');
      if (wrapper.length) {
        $(wrapper).find('select').on('change', function () {
          Drupal.ajax({
            url: settings.file_browser.preview_path + '/' + $(this).val(),
            wrapper: 'file-browser-preview-wrapper'
+8 −7
Original line number Diff line number Diff line
@@ -48,8 +48,9 @@
  Drupal.behaviors.fileBrowserMasonry = {
    attach: function (context) {
      var $item = $('.grid-item', context);
      var $view = $item.parent().once('file-browser-init');
      if ($view.length) {
      var view = once('file-browser-init', $item.parent());
      if (view.length) {
        var $view = $(view);
        $view.prepend('<div class="grid-sizer"></div><div class="gutter-sizer"></div>');

        // Indicate that images are loading.
@@ -88,7 +89,7 @@
  Drupal.behaviors.fileBrowserClickProxy = {
    attach: function (context, settings) {
      if (!settings.entity_browser_widget.auto_select) {
        $('.grid-item', context).once('bind-click-event').click(function () {
        $(once('bind-click-event', '.grid-item', context)).click(function () {
          var input = $(this).find('.views-field-entity-browser-select input');
          input.prop('checked', !input.prop('checked'));
          if (input.prop('checked')) {
@@ -111,14 +112,14 @@
      adjustBodyPadding();
      renderFileCounter();
      // Indicate when files have been selected.
      var $entities = $('.entities-list', context).once('file-browser-add-count');
      if ($entities.length) {
        $entities.bind('add-entities', function (event, entity_ids) {
      var entities = once('file-browser-add-count', '.entities-list', context);
      if (entities.length) {
        $(entities).bind('add-entities', function (event, entity_ids) {
          adjustBodyPadding();
          renderFileCounter();
        });

        $entities.bind('remove-entities', function (event, entity_ids) {
        $(entities).bind('remove-entities', function (event, entity_ids) {
          adjustBodyPadding();
          renderFileCounter();
        });
Loading