@ardimedia/angular-portal-azure 0.2.7 → 0.2.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/apn.d.ts +4 -1
  2. package/apn.js +37 -7
  3. package/package.json +1 -1
package/apn.d.ts CHANGED
@@ -47,6 +47,7 @@ declare namespace angularportalazure {
47
47
  constructor(portalService: angularportalazure.PortalService, path: string, title: string, subtitle?: string, width?: number);
48
48
  listener1: Function;
49
49
  path: string;
50
+ private _path;
50
51
  title: string;
51
52
  subTitle: string;
52
53
  width: {
@@ -123,6 +124,7 @@ declare namespace angularportalazure {
123
124
  onActivate(): void;
124
125
  navigateTo(arg: any): void;
125
126
  onNavigateTo(arg: any): void;
127
+ comparePaths(path1: string, path2: string): boolean;
126
128
  /** close blade. */
127
129
  close(): void;
128
130
  onCommandBrowse(): void;
@@ -203,17 +205,18 @@ declare namespace angularportalazure {
203
205
  }
204
206
  declare namespace angularportalazure {
205
207
  class Tile {
208
+ constructor(title: string, bladePath: string, portalService: angularportalazure.PortalService);
206
209
  portalService: angularportalazure.PortalService;
207
210
  title: string;
208
211
  subTitle: string;
209
212
  bladePath: string;
213
+ private _bladePath;
210
214
  tileSize: angularportalazure.TileSizes;
211
215
  size: string;
212
216
  left: string;
213
217
  top: string;
214
218
  leftN: string;
215
219
  topN: string;
216
- constructor(title: string, bladePath: string, portalService: angularportalazure.PortalService);
217
220
  clicked(): void;
218
221
  }
219
222
  }
package/apn.js CHANGED
@@ -170,6 +170,7 @@ var angularportalazure;
170
170
  if (subtitle === void 0) { subtitle = ''; }
171
171
  if (width === void 0) { width = 200; }
172
172
  _super.call(this, portalService);
173
+ //#endregion
173
174
  this.title = '';
174
175
  this.subTitle = '';
175
176
  this.width = { 'width': '0' };
@@ -239,7 +240,7 @@ var angularportalazure;
239
240
  angularportalazure.Debug.write('[angularportalazure-debug] \'Blade\' constructor called.', [this, portalService, path, title, subtitle, width]);
240
241
  var that = this;
241
242
  this.blade = this;
242
- this.path = path.toLowerCase(); // we do not distinguish between lower and upper case path name
243
+ this.path = path;
243
244
  this.title = title;
244
245
  this.subTitle = subtitle;
245
246
  this.width.width = width + 'px';
@@ -272,13 +273,23 @@ var angularportalazure;
272
273
  // Register listener1
273
274
  this.listener1 = that.portalService.$rootScope.$on('BladeArea.AddBlade', function (event, args) {
274
275
  angularportalazure.Debug.write('[angularportalazure-debug] \'Blade\' BladeArea.AddBlade event processing.', [this, event, args]);
275
- // we do not distinguish between lower and upper case path name
276
- if (args.path.toLowerCase() === that.blade.path) {
276
+ if (that.blade.comparePaths(args.path, that.blade.path)) {
277
277
  that.activate();
278
278
  }
279
279
  });
280
280
  //#endregion
281
281
  }
282
+ Object.defineProperty(Blade.prototype, "path", {
283
+ //#region path
284
+ get: function () {
285
+ return this._path;
286
+ },
287
+ set: function (newPath) {
288
+ this._path = newPath.toLowerCase();
289
+ },
290
+ enumerable: true,
291
+ configurable: true
292
+ });
282
293
  //#endregion
283
294
  //#endregion
284
295
  //#region Methods
@@ -297,6 +308,15 @@ var angularportalazure;
297
308
  Blade.prototype.onNavigateTo = function (arg) {
298
309
  throw new Error('[angularportalazure.Blade] \'onNavigateTo\' is an abstract function. Define one in the derived class.');
299
310
  };
311
+ // At the moment we do not distinguish between lower and upper case path name
312
+ Blade.prototype.comparePaths = function (path1, path2) {
313
+ if (path1.toLowerCase() === path2.toLowerCase()) {
314
+ return true;
315
+ }
316
+ else {
317
+ return false;
318
+ }
319
+ };
300
320
  /** close blade. */
301
321
  Blade.prototype.close = function () {
302
322
  angularportalazure.Debug.write('[angularportalazure-debug] \'Blade.close\' called.', [this]);
@@ -465,7 +485,7 @@ var angularportalazure;
465
485
  //#region Make sure the blade is not yet show
466
486
  this.blades.forEach(function (blade) {
467
487
  // we do not distinguish between lower and upper case path name
468
- if (blade.path.toLowerCase() === path.toLowerCase()) {
488
+ if (blade.comparePaths(blade.path, path)) {
469
489
  throw new Error('[angularportalazure.BladeArea] path: \'' + path + '\' will not be added. It is already added.');
470
490
  }
471
491
  ;
@@ -502,7 +522,7 @@ var angularportalazure;
502
522
  // we do not distinguish between lower and upper case path name
503
523
  path = path.toLowerCase();
504
524
  var isremoved = that.blades.some(function (blade, index) {
505
- if (blade.path === path) {
525
+ if (blade.comparePaths(blade.path, path)) {
506
526
  angularportalazure.Debug.write('[angularportalazure-debug] \'BladeArea.clearPath\' set bladeUrls.length to: ' + index);
507
527
  that.blades.length = index;
508
528
  return true;
@@ -539,7 +559,7 @@ var angularportalazure;
539
559
  }
540
560
  var isremoved = that.blades.some(function (blade, index) {
541
561
  // we do not distinguish between lower and upper case path name
542
- if (blade.path.toLowerCase() === path.toLowerCase()) {
562
+ if (blade.comparePaths(blade.path, path)) {
543
563
  angularportalazure.Debug.write('[angularportalazure-debug] \'BladeArea.clearChild\' set bladeUrls.length to: ' + (index + 1));
544
564
  that.blades.length = index + 1;
545
565
  return true;
@@ -670,7 +690,6 @@ var angularportalazure;
670
690
  var angularportalazure;
671
691
  (function (angularportalazure) {
672
692
  var Tile = (function () {
673
- //#endregion
674
693
  //#region Constructors
675
694
  function Tile(title, bladePath, portalService) {
676
695
  angularportalazure.Debug.write('[angularportalazure-debug] \'Tile\' constructor called.', [this, title, bladePath, portalService]);
@@ -679,6 +698,17 @@ var angularportalazure;
679
698
  this.bladePath = bladePath;
680
699
  this.tileSize = angularportalazure.TileSizes.normal;
681
700
  }
701
+ Object.defineProperty(Tile.prototype, "bladePath", {
702
+ //#region bladePath
703
+ get: function () {
704
+ return this._bladePath;
705
+ },
706
+ set: function (newBladePath) {
707
+ this._bladePath = newBladePath.toLowerCase();
708
+ },
709
+ enumerable: true,
710
+ configurable: true
711
+ });
682
712
  //#endregion
683
713
  //#region Methods
684
714
  Tile.prototype.clicked = function () {
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@ardimedia/angular-portal-azure",
3
3
  "description": "Angular Portal Azure - GUI Framework.",
4
4
  "author": "Ardimedia Anstalt <info@ardimedia.com> (http://www.ardimedia.com)",
5
- "version": "0.2.7",
5
+ "version": "0.2.8",
6
6
  "main": "index.js",
7
7
  "typings": "apn.d.ts",
8
8
  "dependencies": {