@wizishop/img-manager 0.2.75 → 0.2.76

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.
@@ -1984,6 +1984,10 @@
1984
1984
  return;
1985
1985
  }
1986
1986
  this.isLoading = true;
1987
+ if (!this.isImgModified && !this.isNameModified) {
1988
+ this.isLoading = false;
1989
+ this.onEditClosed();
1990
+ }
1987
1991
  var obsReplaceImg = this.imgManagerService.replaceImg(this.currentCroppedImage, this.imgToEdit.id_file);
1988
1992
  var obsChangeImgName = this.imgManagerService.changeImgName(this.imgToEdit.display_name, this.imgToEdit.id_file);
1989
1993
  if (this.isImgModified && this.isNameModified) {
@@ -2059,7 +2063,7 @@
2059
2063
  ImgEditorComponent = __decorate([
2060
2064
  core.Component({
2061
2065
  selector: 'img-editor',
2062
- template: "<div class=\"img-editor\" [@easeInOut]=\"'in'\">\n\n <ng-scrollbar\n #scrollable\n [visibility]=\"'native'\"\n class=\"img-editor__scroll\"\n [ngClass]=\"{\n 'img-editor__scroll--full': stateDisplayed === 'full',\n 'img-editor__scroll--smallDisplay': stateDisplayed === 'small',\n 'img-editor__scroll--window': stateDisplayed === 'window'\n }\"\n >\n <div class=\"columns\">\n <!-- Left section -->\n <div class=\"column is-one-third img-editor__infoSection\">\n\n <info-section\n [imgToEdit]=\"imgToEdit\"\n [(isNameModified)]=\"isNameModified\"\n >\n </info-section>\n\n <!-- Button Action Section -->\n\n <div class=\"img-editor__infoSection__actions\">\n <div>\n <button\n class=\"button img-editor__infoSection__actions__cancel\"\n (click)=\"onCancel()\"\n [disabled]=\"isLoading\"\n >\n {{ 'ImgManager.ImgLib.cancel' | translate }}\n </button>\n <div\n class=\"button danger button img-editor__infoSection__actions__save\"\n [ngClass]=\"{'img-editor__infoSection__actions__save--disable': isLoading}\"\n (click)=\"onSave()\"\n >\n {{ 'ImgManager.ImgEditor.saveBtn' | translate }}\n <span btnLoadingAnim *ngIf=\"isLoading\" class=\"btnLoadingAnnimation\"></span>\n </div>\n\n </div>\n </div>\n </div>\n\n\n <!-- Right section -->\n <div class=\"column img-editor__container\">\n <cropper\n [imgToEdit]=\"imgToEdit\"\n [(isImgModified)]=\"isImgModified\"\n (currentCroppedImageChange)=\"onImgCropped($event)\"\n (editClosed)=\"onEditClosed($event)\">\n </cropper>\n </div>\n </div>\n </ng-scrollbar>\n</div>\n",
2066
+ template: "<div class=\"img-editor\" [@easeInOut]=\"'in'\">\n\n <ng-scrollbar\n #scrollable\n [visibility]=\"'native'\"\n class=\"img-editor__scroll\"\n [ngClass]=\"{\n 'img-editor__scroll--full': stateDisplayed === 'full',\n 'img-editor__scroll--smallDisplay': stateDisplayed === 'small',\n 'img-editor__scroll--window': stateDisplayed === 'window'\n }\"\n >\n <div class=\"columns\">\n <!-- Left section -->\n <div class=\"column is-one-third img-editor__infoSection\">\n\n <info-section\n [imgToEdit]=\"imgToEdit\"\n [(isNameModified)]=\"isNameModified\"\n >\n </info-section>\n\n <!-- Button Action Section -->\n\n <div class=\"img-editor__infoSection__actions\">\n <div>\n <button\n class=\"button img-editor__infoSection__actions__cancel\"\n (click)=\"onCancel()\"\n [disabled]=\"isLoading || (!isImgModified && !isNameModified)\"\n >\n {{ 'ImgManager.ImgLib.cancel' | translate }}\n </button>\n <div\n class=\"button danger button img-editor__infoSection__actions__save\"\n [ngClass]=\"{'img-editor__infoSection__actions__save--disable': isLoading}\"\n (click)=\"onSave()\"\n >\n {{ 'ImgManager.ImgEditor.saveBtn' | translate }}\n <span btnLoadingAnim *ngIf=\"isLoading\" class=\"btnLoadingAnnimation\"></span>\n </div>\n\n </div>\n </div>\n </div>\n\n\n <!-- Right section -->\n <div class=\"column img-editor__container\">\n <cropper\n [imgToEdit]=\"imgToEdit\"\n [(isImgModified)]=\"isImgModified\"\n (currentCroppedImageChange)=\"onImgCropped($event)\"\n (editClosed)=\"onEditClosed($event)\">\n </cropper>\n </div>\n </div>\n </ng-scrollbar>\n</div>\n",
2063
2067
  animations: [
2064
2068
  easeInOut
2065
2069
  ]
@@ -3183,8 +3187,8 @@
3183
3187
  var _this = this;
3184
3188
  this.isLoading = true;
3185
3189
  this.displayPexelsResults = false;
3186
- this.isTotalRetieved = false;
3187
3190
  this.setParams();
3191
+ this.refreshTotalImgList();
3188
3192
  this.imgManager.getShopImgList(this.params).pipe(operators.take(1)).subscribe(function (data) {
3189
3193
  _this.initVariables(true);
3190
3194
  var nbImgDisplayed = data.data.length;
@@ -3202,7 +3206,6 @@
3202
3206
  if (data.totalRecords === 0) {
3203
3207
  _this.displayPexelsLib();
3204
3208
  }
3205
- _this.refreshTotalImgList();
3206
3209
  }, function (error) {
3207
3210
  _this.alertService.openAlert(_this.errorGetAllImg);
3208
3211
  _this.initVariables(false);
@@ -3210,12 +3213,19 @@
3210
3213
  };
3211
3214
  ImagesViewComponent.prototype.refreshTotalImgList = function () {
3212
3215
  var _this = this;
3216
+ var searchValue = this.tableFilters.searchValue;
3217
+ if (this.isTotalRetieved && searchValue === this.previousSearchValue) {
3218
+ // Keep current total result
3219
+ return;
3220
+ }
3221
+ this.isTotalRetieved = false;
3213
3222
  this.imgManager.getShopTotalImgList(this.params).pipe(operators.take(1)).subscribe(function (data) {
3223
+ _this.previousSearchValue = searchValue;
3214
3224
  _this.isTotalRetieved = true;
3215
3225
  _this.length = data.totalRecords;
3216
3226
  _this.tableFilters.totalItems = data.totalRecords;
3217
3227
  }, function (error) {
3218
- _this.alertService.openAlert(_this.errorGetTotalImg);
3228
+ //this.alertService.openAlert(this.errorGetTotalImg);
3219
3229
  _this.initVariables(false);
3220
3230
  });
3221
3231
  };