[fix #453] Disable install button, add share
This commit is contained in:
Родитель
0b662d44d6
Коммит
80dd33f96d
|
@ -7,8 +7,8 @@
|
|||
<!-- Can't show these until we have manifest + discover implemented -->
|
||||
<ul class="list-btns">
|
||||
<li v-if="showInstall"><a class="btn" href="#" v-on="click: install">Add to Homescreen</a></li>
|
||||
<!-- <li><a class="btn" href="">Learn more abut this app</a></li>
|
||||
<li><a class="btn" href="">Share App</a></li> -->
|
||||
<!-- <li><a class="btn" href="">Learn more abut this app</a></li> -->
|
||||
<li><a class="btn" href="#" v-on="click: share">Share App</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -10,6 +10,10 @@ module.exports = {
|
|||
if (e) e.preventDefault();
|
||||
this.$data.showFooter = !this.$data.showFooter;
|
||||
this.toggleOverlay(this.$data.showFooter);
|
||||
},
|
||||
share: function (e) {
|
||||
e.preventDefault();
|
||||
window.location = 'sms:?body=' + window.location;
|
||||
}
|
||||
},
|
||||
created: function () {
|
||||
|
@ -25,7 +29,10 @@ module.exports = {
|
|||
self.toggleShowFooter();
|
||||
}, false);
|
||||
|
||||
if (navigator.mozApps) {
|
||||
// Currently disabled due to single-app-per-origin restriction
|
||||
var allowInstall = false;
|
||||
|
||||
if (allowInstall && navigator.mozApps) {
|
||||
var manifestUrl = location.href + 'manifest.webapp';
|
||||
self.$data.install = function install(e) {
|
||||
e.preventDefault();
|
||||
|
@ -37,7 +44,6 @@ module.exports = {
|
|||
alert('Sorry, we could not install this app: ' + installLocFind.error.name);
|
||||
};
|
||||
};
|
||||
|
||||
var installCheck = navigator.mozApps.checkInstalled(manifestUrl);
|
||||
installCheck.onsuccess = function() {
|
||||
if (installCheck.result) {
|
||||
|
|
Загрузка…
Ссылка в новой задаче