Remove jquery deps in projects.vue
This commit is contained in:
@@ -29,7 +29,6 @@ export default {
|
|||||||
refreshRate: 60,
|
refreshRate: 60,
|
||||||
lastUpdate: { unix_time: 0, relative_time: '', formatted_time: ''},
|
lastUpdate: { unix_time: 0, relative_time: '', formatted_time: ''},
|
||||||
feedPanelOpen: false,
|
feedPanelOpen: false,
|
||||||
feedSimpleBar: null,
|
|
||||||
settingsPanelOpen: false,
|
settingsPanelOpen: false,
|
||||||
markerSize: {width: 32, height: 32},
|
markerSize: {width: 32, height: 32},
|
||||||
currProject: {},
|
currProject: {},
|
||||||
@@ -135,7 +134,7 @@ export default {
|
|||||||
},
|
},
|
||||||
quit() {
|
quit() {
|
||||||
lightbox.end();
|
lightbox.end();
|
||||||
this.$refs.feedSimpleBar.scrollElement.removeEventListener('scroll', (oEvent) => {this.onFeedScroll(oEvent);});
|
this.$refs.feedSimpleBar.scrollElement.removeEventListener('scroll', this.onFeedScroll);
|
||||||
this.setFeedUpdateTimer(-1);
|
this.setFeedUpdateTimer(-1);
|
||||||
this.map.remove();
|
this.map.remove();
|
||||||
},
|
},
|
||||||
@@ -165,7 +164,7 @@ export default {
|
|||||||
},
|
},
|
||||||
async initFeed() {
|
async initFeed() {
|
||||||
//Simplebar event
|
//Simplebar event
|
||||||
this.$refs.feedSimpleBar.scrollElement.addEventListener('scroll', (oEvent) => {this.onFeedScroll(oEvent);});
|
this.$refs.feedSimpleBar.scrollElement.addEventListener('scroll', this.onFeedScroll);
|
||||||
|
|
||||||
//Mobile Touchscreen Events
|
//Mobile Touchscreen Events
|
||||||
//TODO
|
//TODO
|
||||||
@@ -360,10 +359,10 @@ export default {
|
|||||||
return true;
|
return true;
|
||||||
},
|
},
|
||||||
onFeedScroll(oEvent) {
|
onFeedScroll(oEvent) {
|
||||||
//FIXME remove jquery dependency
|
const box = oEvent.currentTarget
|
||||||
var $Box = $(oEvent.currentTarget);
|
const content = box.querySelector('.simplebar-content')
|
||||||
var $BoxContent = $Box.find('.simplebar-content');
|
|
||||||
if(($Box.scrollTop() + $(window).height()) / $BoxContent.height() >= 0.8) this.getNextFeed();
|
if ((box.scrollTop + box.clientHeight) / (content?.offsetHeight || 1) >= 0.8) this.getNextFeed();
|
||||||
},
|
},
|
||||||
setFeedUpdateTimer(iSeconds) {
|
setFeedUpdateTimer(iSeconds) {
|
||||||
if(typeof this.feedTimer != 'undefined') clearTimeout(this.feedTimer);
|
if(typeof this.feedTimer != 'undefined') clearTimeout(this.feedTimer);
|
||||||
@@ -553,13 +552,13 @@ export default {
|
|||||||
else console.log('Missing element ID "'+oPost.id+'" of type "'+oPost.type+'"');
|
else console.log('Missing element ID "'+oPost.id+'" of type "'+oPost.type+'"');
|
||||||
},
|
},
|
||||||
goToPost(oPost) {
|
goToPost(oPost) {
|
||||||
//TODO remove jquery deps
|
|
||||||
let bFound = false;
|
let bFound = false;
|
||||||
let aoRefs = this.$refs.posts.filter((post) => {return post.postId == oPost.type+'-'+oPost.id;});
|
let aoRefs = this.$refs.posts.filter((post) => {return post.postId == oPost.type+'-'+oPost.id;});
|
||||||
if(aoRefs.length == 1) {
|
if(aoRefs.length == 1) {
|
||||||
this.$refs.feedSimpleBar.scrollElement.scrollTop += Math.round(
|
this.$refs.feedSimpleBar.scrollElement.scrollTop += Math.round(
|
||||||
$(aoRefs[0].$el).offset().top
|
aoRefs[0].$el.getBoundingClientRect().top
|
||||||
- parseInt($(this.$refs.feedSimpleBar.$el).css('padding-top'))
|
+ window.pageYOffset
|
||||||
|
- parseFloat(getComputedStyle(this.$refs.feedSimpleBar.$el).paddingTop)
|
||||||
);
|
);
|
||||||
bFound = true;
|
bFound = true;
|
||||||
this.spot.flushHash(['post', 'message']);
|
this.spot.flushHash(['post', 'message']);
|
||||||
|
|||||||
@@ -7,7 +7,6 @@
|
|||||||
import { LngLat } from 'maplibre-gl';
|
import { LngLat } from 'maplibre-gl';
|
||||||
|
|
||||||
import autosize from 'autosize';
|
import autosize from 'autosize';
|
||||||
import { registerRuntimeCompiler } from 'vue';
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
|
|||||||
Reference in New Issue
Block a user