135 lines
6.3 KiB
JavaScript
135 lines
6.3 KiB
JavaScript
(function () {
|
|
angular.module('ticketModule')
|
|
.directive('adminDesigner',
|
|
function ( $compile,$timeout,$state) {
|
|
return {
|
|
restrict: 'E',
|
|
//templateUrl: 'NTTDATA/modules/adminDesigner/views/adminDesignerPanel.html',
|
|
/*scope: {
|
|
state:'=',
|
|
pScope:'=',
|
|
path:'@'
|
|
},*/
|
|
link: function ($scope, element) {
|
|
|
|
/*if($scope.path == "views/layout-configuration/layout-section/editable-layout-section.html") {
|
|
|
|
|
|
var elStr = "<tab id=\"linkedResourcesTab_{{basicData.id}}\" heading=\"{{'ntt.ticket.gtw' | i18n}} ({{relationCounters.gtwV}})\"> <ntt-ticket-gtw ticket=\"basicData\" relation-counters=\"relationCounters\"></ntt-ticket-gtw></tab>";
|
|
var linkFunction = $compile(elStr);
|
|
var newScope = $scope.$new();
|
|
newScope.basicData = $scope.$parent.ticket;
|
|
newScope.relationCounters= $scope.$parent.relationCounters;
|
|
var element = $("ul[role='tablist']");
|
|
var el = linkFunction(newScope);
|
|
element[0].append(el[0]);
|
|
|
|
}*/
|
|
/* scope.$watch(scope.state, function () {
|
|
var x = 0;
|
|
});
|
|
|
|
angular.element(document).ready(function () {
|
|
console.log('page loading completed');
|
|
});*/
|
|
/* $(window).load(function() {
|
|
//...JS here...
|
|
var x = 0;
|
|
});
|
|
|
|
angular.element(document).ready(function() {
|
|
//MANIPULATE THE DOM
|
|
var x = 0;
|
|
|
|
});
|
|
|
|
scope.setTimeout = function(){
|
|
$timeout(function(){
|
|
var x = 0;
|
|
});
|
|
}
|
|
|
|
scope.$on('nttStateChanged', function() {
|
|
$compile(element)(scope);
|
|
});*/
|
|
},
|
|
controller: function($element,$attrs,$scope) {
|
|
|
|
$scope.x = 0;
|
|
$scope.el = $element;
|
|
|
|
if($attrs.path == "views/layout-configuration/layout-section/editable-layout-section.html") {
|
|
|
|
$timeout(function(){
|
|
var elStr = "<tab id=\"linkedResourcesTab_{{basicData.id}}\" heading=\"{{'ntt.ticket.gtw' | i18n}} ({{heading}})\"> <ntt-ticket-gtw ticket=\"basicData\" relation-counters=\"relationCounters\"></ntt-ticket-gtw></tab>";
|
|
//var elStr = "<ntt-ticket-gtw ticket=\"basicData\" relation-counters=\"relationCounters\" x=\"basicData\"></ntt-ticket-gtw>";
|
|
var linkFunction = $compile(elStr);
|
|
|
|
|
|
//var newScope = $scope.$parent.$new();
|
|
var newScope = $scope.$new();
|
|
//$scope.new
|
|
//newScope.basicData = $scope.$parent.ticket;
|
|
//newScope.relationCounters= $scope.$parent.relationCounters;
|
|
/*var elStr = "<tab id=\"linkedResourcesTab_{{basicData.id}}\" heading=\"{{'ntt.ticket.gtw' | i18n}} ({{relationCounters.gtwV}})\"> <ntt-ticket-gtw ticket=\"basicData\" relation-counters=\"relationCounters\"></ntt-ticket-gtw></tab>";
|
|
var insertedEl = $compile(elStr)(newScope);*/
|
|
var element = $("ul[role='tablist']");
|
|
//$scope.el.parent().find("ul[role='tablist']")[0]
|
|
var el = linkFunction(newScope);
|
|
$scope.el.parent().find("ul[role='tablist']")[0].append(el[0]);
|
|
|
|
});
|
|
}
|
|
|
|
|
|
|
|
if($attrs.path == "views/ticket/profiles/task-profile.html") {
|
|
|
|
$timeout(function(){
|
|
var elStr = "<tab id=\"linkedResourcesTab_{{basicData.id}}\" heading=\"{{'ntt.ticket.gtw' | i18n}} ({{heading}})\"> <ntt-ticket-gtw ticket=\"basicData\" relation-counters=\"relationCounters\"></ntt-ticket-gtw></tab>";
|
|
//var elStr = "<ntt-ticket-gtw ticket=\"basicData\" relation-counters=\"relationCounters\" x=\"basicData\"></ntt-ticket-gtw>";
|
|
var linkFunction = $compile(elStr);
|
|
|
|
|
|
//var newScope = $scope.$parent.$new();
|
|
var newScope = $scope.$new();
|
|
//$scope.new
|
|
//newScope.basicData = $scope.$parent.ticket;
|
|
//newScope.relationCounters= $scope.$parent.relationCounters;
|
|
/*var elStr = "<tab id=\"linkedResourcesTab_{{basicData.id}}\" heading=\"{{'ntt.ticket.gtw' | i18n}} ({{relationCounters.gtwV}})\"> <ntt-ticket-gtw ticket=\"basicData\" relation-counters=\"relationCounters\"></ntt-ticket-gtw></tab>";
|
|
var insertedEl = $compile(elStr)(newScope);*/
|
|
var element = $("ul[role='tablist']");
|
|
//$scope.el.parent().find("ul[role='tablist']")[0]
|
|
var el = linkFunction(newScope);
|
|
$scope.el.parent().find("ul[role='tablist']")[0].append(el[0]);
|
|
// $scope.$apply();
|
|
});
|
|
}
|
|
//$('')
|
|
//$timeout
|
|
// $scope.$on('nttStateChanged', function() {
|
|
/* $timeout(function(){
|
|
var x = 0;
|
|
});*/
|
|
// });
|
|
|
|
/* $scope.$watch("state.dataIsLoading", function (newValue,oldValue) {
|
|
var x = 0;
|
|
});
|
|
|
|
$scope.$on('$routeChangeStart', function($event, next, current) {
|
|
var element = $('.app__content');
|
|
var newScope = $rootScope.$new();
|
|
var elStr = "<ntt-ticket-gtw ticket=\"basicData\" relation-counters=\"relationCounters\"></ntt-ticket-gtw>";
|
|
var insertedEl = $compile(elStr)(newScope);
|
|
element.append(insertedEl);
|
|
});*/
|
|
/*var element = $('.app__content');
|
|
var newScope = $rootScope.$new();
|
|
var elStr = "<ntt-ticket-gtw ticket=\"basicData\" relation-counters=\"relationCounters\"></ntt-ticket-gtw>";
|
|
var insertedEl = $compile(elStr)(newScope);
|
|
element.append(insertedEl);*/
|
|
}
|
|
}
|
|
});
|
|
})(); |