Commit c6ad273a authored by Jerome Chauveau's avatar Jerome Chauveau
Browse files

fetch image during 1min (every 2 sec)) after a crop rotate call

parent 9469dd6c
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
{
  "name": "@pdn-certic/vue-jama",
  "version": "0.8.0",
  "version": "0.8.1",
  "scripts": {
    "serve": "rimraf -rf ./node_modules/.cache/vue-loader && vue-cli-service serve",
    "build": "vue-cli-service build",
+1 −1
Original line number Diff line number Diff line
@@ -46,7 +46,7 @@
              currentCollection.id,
              _buildFilterSelection(),
              resourcesSelectionLength,
              collectionsSelectionLength)"
              collectionsSelectionLength);"
          >
            <v-list-item-icon>
              <v-icon>{{ action.icon }}</v-icon>
+9 −2
Original line number Diff line number Diff line
@@ -72,6 +72,13 @@ export default {
    }
  },

  watch: {
    resource: function(){
      this.iconLoaded = false;
      this.fetchTileImage();
    }
  },

  computed: {

    active() {
@@ -95,10 +102,10 @@ export default {
      }
    },


    ...mapGetters(["isPickerMode", "currentResource"])
  },


  beforeMount() {
    if(this.isImageResourceTile()){
      this.iconLoaded = false;
@@ -139,7 +146,7 @@ export default {
    },

    async fetchTileImage(){
      let maxTrials = 10;
      let maxTrials = 30;
      const sleep = (ms) => new Promise((r) => setTimeout(r, ms));//test
      for(let trials = 0; trials < maxTrials; trials++){
        console.info('try to fetch img, trial ' + trials);
+1 −3
Original line number Diff line number Diff line
@@ -470,7 +470,6 @@ export default {
                this.imageDimensions = {width: json.width, height: json.height};
                this.updateRotatedImageDimension();
            })).catch((error) => {
                this.$jamaAlert(error);
                this.loading = false;
            });
        },
@@ -520,7 +519,6 @@ export default {
        autoFindAngle() {
            this.loading = true;
            this.$jamaClient.autoFindRotateAngle(this.resource.id).then((angle) => {
                console.log("AUTO FOUND ANGLE = ", angle)
                this.rotation = Number(angle);
                this.loading = false;
            })
@@ -668,7 +666,7 @@ export default {
                document.getElementById('img-viewer').style.transform = 'scale(' + this.zoom + ')';
                document.getElementById('img-viewer').style.transformOrigin = origin;
            } catch (e) {
                console.log(e);
                console.debug(e);
                this.$jamaAlert("Une erreur est survenue.");
            }
        },
+2 −2
Original line number Diff line number Diff line
@@ -40,7 +40,7 @@ export default {
      viewer: null,
      loading: false,
      tiledSources: [],
      maxFetchTrials : 5,
      maxFetchTrials : 30,
      currentTrials: 0,
      pollInterval: null,
    }
@@ -88,7 +88,7 @@ export default {
              clearInterval(this.pollInterval);
          }
        })
      },1000)
      },2000)
    },

    updateImageViewer() {
Loading