- Timestamp:
- 2022-01-11T11:32:12+13:00 (2 years ago)
- Location:
- main/trunk/model-interfaces-dev/atea/ocr/src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/model-interfaces-dev/atea/ocr/src/components/OcrImageDisplay.vue
r35805 r35954 146 146 }, 100); 147 147 }, 148 magnifierZoom( ) {148 magnifierZoom(newValue) { 149 149 if (this.showThresholdedImage) { 150 150 this.updateMagnifier(this.$refs.thresholdedImage); … … 153 153 this.updateMagnifier(this.$refs.ocrImage); 154 154 } 155 } 155 156 localStorage.setItem("magnifierZoom", newValue); 157 }, 158 enableMagnifier(newValue) { 159 localStorage.setItem("enableMagnifier", newValue); 160 } 161 }, 162 beforeMount() { 163 this.enableMagnifier = localStorage.getItem("enableMagnifier") === "true"; 156 164 }, 157 165 mounted() { … … 159 167 this.updateMagnifier(this.$refs.ocrImage); 160 168 }, 100); 169 170 this.magnifierZoom = localStorage.getItem("magnifierZoom") ?? "1.5"; 161 171 } 162 172 } … … 218 228 219 229 .controls { 230 opacity: 1; 231 } 232 233 .magnifier { 220 234 opacity: 1; 221 235 } … … 274 288 cursor: none; 275 289 border-radius: 40%; 290 291 transition: opacity var(--transition-duration); 292 opacity: 0; 276 293 } 277 294 </style> -
main/trunk/model-interfaces-dev/atea/ocr/src/main.js
r35743 r35954 3 3 import App from "./App.vue"; 4 4 import ToggleButton from "./components/ToggleButton.vue" 5 6 // Polyfill localstorage with an in-memory solution for old browsers. 7 // Adapted from https://gist.github.com/juliocesar/926500#gistcomment-1620487 8 try { 9 window.localStorage.setItem("test_localstorage_available", "1"); 10 window.localStorage.removeItem("test_localstorage_available"); 11 } 12 catch (error) { 13 window.localStorage = { 14 _data: {}, 15 setItem: function (id, val) { 16 this._data[id] = String(val); 17 }, 18 getItem: function (id) { 19 return Object.prototype.hasOwnProperty.call(this._data, id) ? this._data[id] : undefined; 20 }, 21 removeItem: function (id) { 22 return delete this._data[id]; 23 }, 24 clear: function () { 25 this._data = {}; 26 } 27 }; 28 } 5 29 6 30 const store = createStore({
Note:
See TracChangeset
for help on using the changeset viewer.