OPERATION_DELETE: 'DELETE',
OPERATION_POST: 'POST',
REQUEST_DATA_TYPE_RECEIVED: 'RECEIVED',
+ ICON_EXPAND_ADD: 'add',
+ ICON_COLLAPSE_REMOVE: 'remove',
+ ICON_KEYBOARD_ARROW_RIGHT: 'keyboard_arrow_right',
+ EXPAND_LEVEL_THREE: '3',
};
});
* Set and expand module in tree
*/
function setModule(module, e){
- if ( $(e.target).hasClass('top-element') ) {
+ if ( angular.element(e.target).hasClass('top-element') ) {
module.expanded = !module.expanded;
}
}
'use strict';
angular.module('app.yangman').directive('abnApiTree', [
- '$timeout', function ($timeout) {
+ '$timeout', 'constants', function ($timeout, constants) {
return {
restrict: 'E',
templateUrl: 'src/app/yangman/views/directives/abn-tree.tpl.html',
tree;
if (attrs.iconExpand == null) {
- attrs.iconExpand = 'add';
+ attrs.iconExpand = constants.ICON_EXPAND_ADD;
}
if (attrs.iconCollapse == null) {
- attrs.iconCollapse = 'remove';
+ attrs.iconCollapse = constants.ICON_COLLAPSE_REMOVE;
}
if (attrs.iconLeaf == null) {
- attrs.iconLeaf = 'keyboard_arrow_right';
+ attrs.iconLeaf = constants.ICON_KEYBOARD_ARROW_RIGHT;
}
if (attrs.expandLevel == null) {
- attrs.expandLevel = '3';
+ attrs.expandLevel = constants.EXPAND_LEVEL_THREE;
}
expandLevel = parseInt(attrs.expandLevel, 10);
if (!scope.treeData) {
* Hide main menu
*/
function hideMainMenu(){
- $('#wrapper').addClass('toggled');
+ angular.element('#wrapper').addClass('toggled');
}
/**
*/
function setDraggableLeftPanel(){
if (localStorage.getItem('yangman__left-panel-width') !== null) {
- $('#left-panel').width(localStorage.getItem('yangman__left-panel-width'));
+ angular.element('#left-panel').width(localStorage.getItem('yangman__left-panel-width'));
}
- $('.ym-resizable-e').resizable({
+ angular.element('.ym-resizable-e').resizable({
handles: 'e',
minWidth: 300,
stop: function(event, ui) {
function setJsonSplitter(cbk){
$timeout(function () {
- $('.ym-resizable-s').resizable({
+ angular.element('.ym-resizable-s').resizable({
handles: 's',
minHeight: 200,
stop: function(event, ui) {
* .yangmanModule__module-detail .tabs
*/
function setModuleDetailHeight() {
- var height = 'calc(100% - ' + $('.yangmanModule__module-detail h4').outerHeight(true) + 'px)';
- $('.yangmanModule__module-detail .tabs').css({ height: height });
+ var height = 'calc(100% - ' + angular.element('.yangmanModule__module-detail h4').outerHeight(true) + 'px)';
+ angular.element('.yangmanModule__module-detail .tabs').css({ height: height });
}
}