Skip to content

Conversation

@patricklx
Copy link
Contributor

Make the TooltipBoxController internal and some mixins for route and view.
Then Instead of doing

//Create some controller in your app that references _Bootstrap.TooltipBoxController_
App.TooltipBoxController = Bootstrap.TooltipBoxController

//Application route
App.ApplicationRoute = Ember.Route.extend({
    renderTemplate: function() {
        // Render default outlet
        this.render();
        // render extra outlets
        var controller = this.controllerFor('tooltip-box');
        this.render("bs-tooltip-box", {
            outlet: "bs-tooltip-box",
            controller: controller,
            into: "application" // important when using at root level
        });
    }
});

We can just do

var ApplicationRoute = Ember.Route.extend(Bootstrap.BsTooltipRouteMixin, {});

or for views

Ember.View.extend(Bootstrap.BsTooltipViewMixin, {
    bsTooltipData: function () {
        return Ember.Object.create({
            item: this.get('item'),
            titleBinding: 'item.attributes.description'
        });
    }.property(),
    bsTooltipType: 'tooltip',
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant