Refactored basic mode to a directive.

This commit is contained in:
Gunther Brunner
2014-05-27 19:03:53 +09:00
parent eb3e7a40cc
commit 6429a681be
6 changed files with 45 additions and 9 deletions

View File

@@ -0,0 +1,15 @@
module.exports = function basicModeDirective($rootScope, BrowserInfo) {
return {
restrict: 'AE',
link: function (scope, element, attrs) {
$rootScope.basicMode = !!BrowserInfo.small // TODO: use .mobile
if ($rootScope.basicMode) {
element.addClass('basic-mode')
}
if (BrowserInfo.mobile) {
element.addClass('mobile')
}
}
}
}