Project:Nodereference Explorer
Version:6.x-1.x-dev
Component:Code
Category:feature request
Priority:normal
Assigned:Unassigned
Status:closed (fixed)

Issue Summary

The explorer.actions.js loads again any css and js existing in the main page.
jQuery UI Dialog, doesn't need any of that once it has the css already loaded and it installs any required js, and it doesn't execute any extra code than views, jquery ui and own js.
I believe that neither Modal Frame need that files.

  else { //built-in default behaviour
    //get the dialog and its settings via menu call back
    $.getJSON(settings['dialog'], function(data, textStatus) {
//      Drupal.nodereference_explorer.addCSS(data.css); //add css files <<<<<<<<<<<<<<<<<<
      //add js files
  var inlines = Drupal.nodereference_explorer.addJS(data.js);
//   Drupal.nodereference_explorer.addInlineJS(inlines);  <<<<<<<<<<<<<<<<<<<<<<<<

  var options = data.js.setting.dialog; //dialog options
      var actions = data.js.setting.actions;
  options.buttons = Drupal.nodereference_explorer.dialog.addButtonPane(actions, settings);
  Drupal.nodereference_explorer.dialog.open(data.data, options, $('#' + settings['widget']).val()); //open the dialog
  //when dialog is opened, remove progress
  Drupal.nodereference_explorer.actions.endProgress(action);
});
  }
}

So is there some effect removing this two lines?

Comments

#1

The idea is to load the jQuery UI libraries and CSS theme files on demand. IE requires the CSS to be reloaded, maybe it's a better approach to preload all files with the node form.

#2

I think that the loading at once on the node form page is better, approach. First click on "Browse" button generates around 60-70 GET requests - we lists images in nodebrowser, but more than half are CSS and JS files. There is also problem with JS and CSS optimalization than.

I made patch for that ...
http://drupal.org/node/564882#comment-2240976

But loading all needed files at once will be IMHO better and also much simpler.

#3

Status:active» fixed

Due to the latest patch in #564882, all js and css are cleanly loaded on demand.

#4

Status:fixed» closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.