Toolroom Tech Blog

Devlopers Digest

KalEl - A plain JavaScript DateTime Picker and Calendar

First working beta of KalEl plain JavaScript DateTime Picker and Calendar is online: https://github.

First working beta of KalEl plain JavaScript DateTime Picker and Calendar is online:

Or watch the demo here: https://rawgit.com/frogster/KalEl/master/demo/index.html

Route specific CSS in Ember.js

Often we want to use route specific css in our apps. In Ember you can simply make the route itself responsible to add css classes to your Body.

Often we want to use route specific css in our apps. In Ember you can simply make the route itself responsible to add css classes to your body.

Ember.Route.reopen({
  activate: function() {
      Ember.$('body').addClass(this.get('routeClassName'));
  },
  deactivate: function() {
      Ember.$('body').removeClass(this.get('routeClassName'));
  },
  routeClassName: function() {
      var routeClassName = this.routeName.replace(/\./g, '-').dasherize();
      //Instead of the application route name we use the app name
      if(routeClassName === 'application') {
          routeClassName = 'dweedo';
      }
      return routeClassName;
  }.property('routeName')
});