From 37a81d74cd3296e5b7c87aeafbd21058bec77a12 Mon Sep 17 00:00:00 2001 From: andy Date: Thu, 15 Feb 2018 22:51:08 +0000 Subject: [PATCH] fix various --- src/vue-poc/app.vue | 2 +- src/vue-poc/components/vp-notifications.vue | 15 +++++++++++++++ src/vue-poc/components/vue-ace.vue | 2 +- src/vue-poc/features/images/images.xqm | 2 +- src/vue-poc/static/app-gen.js | 21 ++++++++++++++++++--- src/vue-poc/static/app.html | 6 +++--- 6 files changed, 39 insertions(+), 9 deletions(-) diff --git a/src/vue-poc/app.vue b/src/vue-poc/app.vue index 4990178..5521056 100644 --- a/src/vue-poc/app.vue +++ b/src/vue-poc/app.vue @@ -76,7 +76,7 @@ - + {{ $notification.unseen }} notifications diff --git a/src/vue-poc/components/vp-notifications.vue b/src/vue-poc/components/vp-notifications.vue index 9c16812..f2c673b 100644 --- a/src/vue-poc/components/vp-notifications.vue +++ b/src/vue-poc/components/vp-notifications.vue @@ -40,6 +40,9 @@ props: { showNotifications: Boolean }, + data:function(){ + return {timer:null}; + }, methods:{ set(v){ this.$emit('update:showNotifications', v) @@ -47,5 +50,17 @@ refresh(){ this.$forceUpdate(); } + }, + watch:{showNotifications(v){ + if(v){ + this.refresh(); + if(!this.timer) this.timer=setInterval(()=>{ this.refresh() }, 1000); + } + }, + beforeDestroy(){ + if(this.timer) clearTimeout(this.timer); + alert("notifi gone") + } + } } diff --git a/src/vue-poc/components/vue-ace.vue b/src/vue-poc/components/vue-ace.vue index a1c4664..89edce7 100644 --- a/src/vue-poc/components/vue-ace.vue +++ b/src/vue-poc/components/vue-ace.vue @@ -107,7 +107,7 @@ event fired cmd outline this.applySettings(this.aceSettings) this.editor.$blockScrolling = Infinity console.log("setValue: ",this.content) - this.editor.setValue(this.content, 1) + this.editor.setValue((this.content == null)?"NULL":this.content, 1); this.editor.setOptions({ readOnly:this.readOnly }); if(this.minLines){ this.editor.setOptions({ minLines: this.minLines}) diff --git a/src/vue-poc/features/images/images.xqm b/src/vue-poc/features/images/images.xqm index c9b5bb7..1e9746e 100644 --- a/src/vue-poc/features/images/images.xqm +++ b/src/vue-poc/features/images/images.xqm @@ -169,7 +169,7 @@ let $name:=$vue-api:entity?access?name($image) let $geo:=$vue-api:entity?json?geo($image) let $keywords:=$vue-api:entity?json?keywords($image) let $thumb:= $cfg:THUMBDIR || $path -let $thumb:=if(file:exists($thumb)) then $thumb else $cfg:THUMBDIR || "missing.jpg" +let $thumb:=if(file:exists($thumb)) then $thumb else resolve-uri("missing.jpg") return ( {$id} ,{$name} diff --git a/src/vue-poc/static/app-gen.js b/src/vue-poc/static/app-gen.js index 25d49fd..4bf03eb 100644 --- a/src/vue-poc/static/app-gen.js +++ b/src/vue-poc/static/app-gen.js @@ -1,4 +1,4 @@ -// generated 2018-02-13T22:26:57.352Z +// generated 2018-02-15T22:49:15.318Z // src: file:///C:/Users/andy/git/vue-poc/src/vue-poc/components/qd-confirm.vue Vue.component('qd-confirm',{template:` @@ -369,6 +369,9 @@ Vue.component('vp-notifications',{template:` props: { showNotifications: Boolean }, + data:function(){ + return {timer:null}; + }, methods:{ set(v){ this.$emit('update:showNotifications', v) @@ -376,6 +379,18 @@ Vue.component('vp-notifications',{template:` refresh(){ this.$forceUpdate(); } + }, + watch:{showNotifications(v){ + if(v){ + this.refresh(); + if(!this.timer) this.timer=setInterval(()=>{ this.refresh() }, 1000); + } + }, + beforeDestroy(){ + if(this.timer) clearTimeout(this.timer); + alert("notifi gone") + } + } } ); @@ -483,7 +498,7 @@ Vue.component('vue-ace',{template:` this.applySettings(this.aceSettings) this.editor.$blockScrolling = Infinity console.log("setValue: ",this.content) - this.editor.setValue(this.content, 1) + this.editor.setValue((this.content == null)?"NULL":this.content, 1); this.editor.setOptions({ readOnly:this.readOnly }); if(this.minLines){ this.editor.setOptions({ minLines: this.minLines}) @@ -4289,7 +4304,7 @@ const Vuepoc=Vue.extend({template:` - + {{ $notification.unseen }} notifications diff --git a/src/vue-poc/static/app.html b/src/vue-poc/static/app.html index fde22af..0184391 100644 --- a/src/vue-poc/static/app.html +++ b/src/vue-poc/static/app.html @@ -21,7 +21,7 @@
-

vue-poc (v0.3.??)

+

vue-poc (v0.3.1)

@@ -38,8 +38,8 @@ - - + +