raty icon indicating copy to clipboard operation
raty copied to clipboard

Issue with Cached pages and turbolinks

Open mmplisskin opened this issue 8 years ago • 0 comments

With Turbolinks and Jquery it seems that when a cached page is loaded the rate function can duplicate stars. I could not find a way to remove stars from an element with the library but my solution was to return early.

  $.fn.raty = function(method) {
    if ($(this).children().length != 0){
      return;
    }
    ....
  };

Another option would to be allow undo of .raty() so that before the page is cached we can remove the stars from the elements.

Curious to hear your thoughts on this.

mmplisskin avatar Feb 01 '17 08:02 mmplisskin