mirror of
https://github.com/DeviceFarmer/stf.git
synced 2026-04-18 08:03:30 +02:00
Refactored basic mode to a directive.
This commit is contained in:
15
res/app/components/stf/basic-mode/basic-mode-directive.js
Normal file
15
res/app/components/stf/basic-mode/basic-mode-directive.js
Normal 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')
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user