]> git.immae.eu Git - perso/Immae/Projets/Nodejs/Surfer.git/blobdiff - app/js/app.js
Ensure tooltips are working
[perso/Immae/Projets/Nodejs/Surfer.git] / app / js / app.js
index c0ed6160afa430d5a70b0af33c328584e746eaa8..0d6144e37c53023e44f2a2171f1649de2948249b 100644 (file)
@@ -63,6 +63,12 @@ function loadDirectory(filePath) {
         app.entries = result.body.entries;
         app.path = filePath;
         app.pathParts = filePath.split('/').filter(function (e) { return !!e; });
+
+        Vue.nextTick(function () {
+            $(function () {
+                $('[data-toggle="tooltip"]').tooltip();
+            });
+        });
     });
 }
 
@@ -149,6 +155,11 @@ function createDirectory(name) {
     });
 }
 
+Vue.filter('prettyDate', function (value) {
+    var d = new Date(value);
+    return d.toDateString();
+});
+
 var app = new Vue({
     el: '#app',
     data: {
@@ -177,8 +188,6 @@ var app = new Vue({
     }
 });
 
-window.app = app;
-
 login(localStorage.username, localStorage.password);
 
 })();