Skip to content
This repository has been archived by the owner on Jul 8, 2024. It is now read-only.

messi.load preloader (Messi #23) #17

Open
kgust opened this issue Apr 2, 2014 · 0 comments
Open

messi.load preloader (Messi #23) #17

kgust opened this issue Apr 2, 2014 · 0 comments
Assignees
Labels
Milestone

Comments

@kgust
Copy link
Member

kgust commented Apr 2, 2014

marcosesperon#23

Would be nice if you put a preloader to load function.
From this:

load: function(url, options) {

options = jQuery.extend(options || {}, {show: true, unload: true, params: {}});

var request = {
  url: url,
  data: options.params,
  dataType: 'html',
  cache: false,
  error: function (request, status, error) {
    console.log(request.responseText);
  },
  success: function(html) {
    //html = jQuery(html);
    new Messi(html, options);
  }
};

jQuery.ajax(request);

}

to this:

load: function(url, options) {

options = jQuery.extend(options || {}, {show: true, unload: true, params: {}});
var loadMessi = new Messi('<div class="messi-preloader"></div>', options);

var request = {
  url: url,
  data: options.params,
  dataType: 'html',
  cache: false,
  error: function (request, status, error) {
    console.log(request.responseText);
  },
  success: $.proxy(function(html) {
    //html = jQuery(html);
    $('.messi-preloader', this.messi).remove();
    $('.messi-content', this.messi).append(html);
            this.resize(); // resize with new content
  }, loadMessi)
};

jQuery.ajax(request);

}
@kgust kgust added this to the 2.0.0-beta milestone Apr 2, 2014
@kgust kgust modified the milestones: 2.0.0, 2.0.0-beta Apr 2, 2014
@kgust kgust modified the milestones: 2.1.0, 2.0.0 Jun 24, 2014
@kgust kgust self-assigned this Aug 6, 2014
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

1 participant