enyo / opentip

Opentip is an open source javascript tooltip based on the protoype framework.
http://www.opentip.org
1.25k stars 401 forks source link

how to trigger opentip after render backbone template #91

Closed yunusozcan closed 10 years ago

mkasson commented 10 years ago

Override render and include the opentip in the new render function.

var Bookmark = Backbone.View.extend({
  template: _.template(...),
  render: function() {
    this.$el.html(this.template(this.model.attributes));
//Something like the following
           new Opentip(this.$el, "Template Rendered!!", 
              { target: this.$el, , showOn: "creation", 
                  hideTrigger: "closeButton", style: "alert"});

    return this;
  }
});
ptica commented 9 years ago

if you want to initialise opentip on rendered elements you may need Opentip.findElements();