From d2547fbde86aea063eac52ea71f209f040cdfc72 Mon Sep 17 00:00:00 2001 From: Armand Bahi <armand.bahi@veremes.com> Date: Mon, 26 Nov 2018 12:12:30 +0100 Subject: [PATCH] Bug impressions comparaison : scope.compare_mode not interpreted --- module/javascript/app/vmap/tools/print.js | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/module/javascript/app/vmap/tools/print.js b/module/javascript/app/vmap/tools/print.js index 11d16df7..f05db85a 100644 --- a/module/javascript/app/vmap/tools/print.js +++ b/module/javascript/app/vmap/tools/print.js @@ -379,7 +379,7 @@ nsVmap.nsToolsManager.Print.prototype.printController.prototype.loadModelParmas2 this.printBox_.show(); if(this.$scope_["$root"]["compare_enabled"]){ - this.oComparePrintMapSize = this.getPrintedMapSize(this.template_,"#map1Compare","#map_image_compare"); + this.oComparePrintMapSize = this.getPrintedMapSize(this.template_, "#map1Compare", "#map_image_compare"); if(this.oComparePrintMapSize !== 0){ // Pré-rempli le champ "Résolution" this['resolutionCompare'] = this.oComparePrintMapSize.resizeCoeff; @@ -395,6 +395,8 @@ nsVmap.nsToolsManager.Print.prototype.printController.prototype.loadModelParmas2 } } + // Supprime le template du body de Vmap + $(this.template_).remove(); }; /** @@ -420,11 +422,18 @@ nsVmap.nsToolsManager.Print.prototype.printController.prototype.setTemplate = fu }); } + this.$scope_['compare_mode'] = this.$scope_["$root"]["compare_enabled"]; + if (goog.isDefAndNotNull(oModel['definition'])) { var template = document.createElement("div"); template.innerHTML = oModel['definition']; + + this.$compile_(template)(this.$scope_); this_.template_ = template; - callback.call(this, [template]); + + setTimeout(function () { + callback.call(this_, [template]); + }); } }; @@ -450,6 +459,8 @@ nsVmap.nsToolsManager.Print.prototype.printController.prototype.getPrintedMapSiz return 0; } + oPrintScope = angular.element($(template).find(sPrintId)).scope(); + // Ajoute temporairement le template au body de Vmap $(template).addClass('print_template'); $('body').append(template); @@ -457,9 +468,6 @@ nsVmap.nsToolsManager.Print.prototype.printController.prototype.getPrintedMapSiz var mapHeight = imageDiv.height(); var mapWidth = imageDiv.width(); - // Supprime le template du body de Vmap - $(template).remove(); - // Vérifie si la taille de la carte est suppérieur à la taille de l'écran var resizeCoeff = 1; var tmpWidth = angular.copy(mapWidth); -- GitLab