sonic icon indicating copy to clipboard operation
sonic copied to clipboard

Ensures all CSS files are loaded before showing the injected fragment / Simple resource management

Open gordyr opened this issue 13 years ago • 0 comments

Two main changes:-

  1. Hides fragment until all CSS files added via the "addCss" method are loaded. from my apps homepag
  2. Simple resource management - Keeps a log of add JS/CSS files and checks against them before loading them. This is very useful when dynamically loading fragments via ajax calls in order to prevent repeated http requests.

e.g. When navigating from my applications 'welcome' page to 'user control panel' only a single fragment needs to be updated rather than a full page load. Therefore I perform an ajax request to get the html of the required fragment. With the above changes, the response of this request was reduced down to around 200ms from about 800ms. You can now essentially specify all required resources needed to render a fragment without repeating requests under any circumstance (ajax request or full page load).

NOTE: Please look at the full file from the latest 'commit' as it took me a while to get to grips with the way pull requests work in github. My apologies.

gordyr avatar Jul 09 '12 11:07 gordyr