Add refresh button when not on mobile (pull refresh is bad with a mouse)

master
Skylar Ittner 5 years ago
parent 3f055b44d2
commit 552ccf4ff7

@ -4,6 +4,7 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. * file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/ */
var platform_type = "";
function initCordova() { function initCordova() {
// Handle back button to close things // Handle back button to close things
@ -17,9 +18,12 @@ function initCordova() {
StatusBar.styleLightContent(); StatusBar.styleLightContent();
} }
}, false); }, false);
platform_type = "cordova";
} }
function initNW() { function initNW() {
platform_type = "nw";
// TODO: something clever with desktop integration // TODO: something clever with desktop integration
} }

@ -8,8 +8,13 @@
<div class="title">NotePost</div> <div class="title">NotePost</div>
<div class="right"> <div class="right">
{{#if showrefreshbtn}}
<a href="#" class="link icon-only" onclick="app.ptr.refresh()">
<i class="material-icons">refresh</i>
</a>
{{/if}}
<a href="/settings" class="link icon-only"> <a href="/settings" class="link icon-only">
<i class="fas fa-cog"></i> <i class="material-icons">settings</i>
</a> </a>
</div> </div>
</div> </div>

@ -22,7 +22,8 @@ var routes = [
reloadCurrent: (routeFrom.name == "home") reloadCurrent: (routeFrom.name == "home")
}, { }, {
context: { context: {
notecards: notecards notecards: notecards,
showrefreshbtn: (platform_type != "cordova")
} }
}); });
}); });

Loading…
Cancel
Save