Commit 40b79d66 authored by Paolo Greppi's avatar Paolo Greppi

non-working prototype

parent 0683de95
......@@ -28,3 +28,5 @@ all:
cp bower_components/es6-promise/es6-promise.auto.min.js www/js/.
cp bower_components/es6-promise/es6-promise.auto.min.map www/js/.
cp bower_components/shallow-equals/index.js www/js/shallow-equals.js
cp bower_components/slip/slip.js www/js/.
......@@ -25,6 +25,7 @@
"vue-router": "^2.7.0",
"idb-keyval": "*",
"shallow-equals": "https://github.com/hughsk/shallow-equals.git#^1.0.0",
"es6-promise": "^4.1.1"
"es6-promise": "^4.1.1",
"slip": "^2.1.0"
}
}
......@@ -27,3 +27,6 @@ main {
.alert-lightinfo {
background-color: #F3FAFD;
}
#slippylist {
margin-left: -40px;
}
......@@ -33,7 +33,19 @@ var app = new Vue({
directives: { InfiniteScroll: infiniteScroll },
el: '#app',
methods: { },
created: function() { }
created: function() {
var list = document.getElementById('slippylist');
list.addEventListener('slip:swipe', function(e) {
// e.target list item swiped
if (thatWasSwipeToRemove) {
// list will collapse over that element
e.target.parentNode.removeChild(e.target);
} else {
e.preventDefault(); // will animate back to original position
}
});
new Slip(list);
}
});
document.addEventListener('DOMContentLoaded', function() {
......
This diff is collapsed.
<script type="text/x-template" id="news-item-template">
<div style="flex-direction: row; line-height: 1.1;" class="card mb-3" v-bind:class="{ 'bg-light': news.read, 'border-primary': news.views > 0 && !news.read }">
<li style="flex-direction: row; line-height: 1.1;" class="card mb-3" v-bind:class="{ 'bg-light': news.read, 'border-primary': news.views > 0 && !news.read }">
<?php if ($decoded): ?>
<router-link v-bind:to="'/feed/' + news.feed_id" v-bind:title="'vai a tutti gli articoli della fonte ' + news.feed">
<img style="margin: 5px;" class="card-img-left" width="30px" height="30px" v-bind:src="'/' + news.icon" alt="feed logo">
......@@ -52,7 +52,7 @@
</a>
</div>
<?php endif; ?>
</div>
</li>
</script>
<script type="text/javascript">
// configuration for jshint
......
......@@ -108,7 +108,9 @@
<h2>Risultati della ricerca a tutto testo di "{{ query }}"</h2>
</template>
<div style="display:none;" v-show="retrieved >= 0 && !busy && news.length == 0">Mi spiace, non trovo niente ...</div>
<news-item v-for="n in news" v-bind:news="n" :key="n.id"></news-item>
<ul id="slippylist" style="margin-left: -40px;">
<news-item v-for="n in news" v-bind:news="n" :key="n.id"></news-item>
</ul>
<div class="mx-auto" style="width: 50px;" v-show="busy">
<img src="/images/loading.gif" width="50px" height="50px"/>
</div>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment