kadirahq / blaze-layout

Layout Manager for Blaze (works well with Meteor FlowRouter)
MIT License
198 stars 62 forks source link

Problem with AdminLTE body class! #66

Open thearabbit opened 8 years ago

thearabbit commented 8 years ago

I would like to add <body class="hold-transition skin-blue sidebar-mini">, but don't work with blaze layout.

// Main Layout
<template name="AdminLTELayout">
   <body class="hold-transition skin-blue sidebar-mini">
   .............................
   </body>
</template>

// Flow Router
FlowRouter.route('/', {
    name: 'home',
    title: 'Home',
    action: function (params, queryParams) {
        BlazeLayout.render('AdminLTELayout', {content:'Home'});
    }
});

Please help me.

gibson commented 8 years ago

you dont need to set body as template - create empty html file and write <body class="hold-transition skin-blue sidebar-mini"></body> and Add following code inside on the top of one of your client side JS file:

BlazeLayout.setRoot('body');

thearabbit commented 8 years ago

Thanks for your reply, but I would like to add some class="hold-transition skin-blue sidebar-mini" to the body. How to...?

pbatey commented 7 years ago

This worked for me:

Template.myTemplate.onRendered(function() {
  $('body').addClass('hold-transition skin-blue sidebar-mini')
})
thearabbit commented 7 years ago

Now it work fine, but have problem with event click on Navigation Bar. How to attach event?

pbatey commented 7 years ago

Uh... I use Blazejs for my templates - not sure what you're using... here's the doc: http://blazejs.org/api/templates.html#Event-Maps

Templates.MyTemplate.events({
    'click .navbar'(event) { ... }
})

On Fri, Dec 16, 2016 at 5:50 PM, Yuom Theara notifications@github.com wrote:

Now it work fine, but have problem with event click on Navigation Bar. How to attach event?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/kadirahq/blaze-layout/issues/66#issuecomment-267730515, or mute the thread https://github.com/notifications/unsubscribe-auth/AEXWhcYl8BQq8huJlGAed6lwUvG2rNewks5rIzHdgaJpZM4HuuzP .