fixed app install error display issue (mobile only)
This commit is contained in:
Родитель
f374a50cc4
Коммит
276c0e6d46
|
@ -18,7 +18,7 @@
|
|||
{% for link in links %}
|
||||
{% set extra = "platform " + link.os.shortname if link.os else "" %}
|
||||
<!-- install error messages -->
|
||||
<div class="apps-error-msg"></div>
|
||||
<div class="apps-error-msg"><h2></h2><p></p></div>
|
||||
{% include 'addons/includes/install_button.html' %}
|
||||
{% endfor %}
|
||||
</div>
|
||||
|
|
|
@ -39,7 +39,7 @@ exports.install = function(manifestUrl, opt) {
|
|||
'success': undefined,
|
||||
'error': undefined,
|
||||
'errModalCallback': undefined}, opt || {});
|
||||
var self = this,
|
||||
var self = apps,
|
||||
errSummary,
|
||||
showError = true;
|
||||
/* Try and install the app. */
|
||||
|
@ -84,15 +84,24 @@ exports.install = function(manifestUrl, opt) {
|
|||
};
|
||||
|
||||
exports._showError = function(errSummary, errMessage, opt) {
|
||||
var $errTarget = $('<a>'),
|
||||
$modal = $('.apps-error-msg:first', opt.domContext).modal(
|
||||
$errTarget,
|
||||
{width: '400px', close: true,
|
||||
callback: opt.errModalCallback});
|
||||
$errTarget.trigger('click'); // show the modal
|
||||
$('.apps-error-msg h2', opt.domContext).text(errSummary);
|
||||
$('.apps-error-msg p', opt.domContext).text(errMessage);
|
||||
$(opt.domContext).trigger('error_shown.apps');
|
||||
var $errTarget = $('<a>');
|
||||
if (opt.mobile) {
|
||||
var $errBox = $('.apps-error-msg h2', opt.domContext);
|
||||
$('.apps-error-msg h2', opt.domContext).text(errSummary);
|
||||
$('.apps-error-msg p', opt.domContext).text(errMessage);
|
||||
$('.apps-error-msg').show();
|
||||
} else {
|
||||
var $modal = $('.apps-error-msg:first', opt.domContext).modal(
|
||||
$errTarget,
|
||||
{width: '400px', close: true,
|
||||
callback: opt.errModalCallback
|
||||
});
|
||||
$errTarget.trigger('click'); // show the modal
|
||||
$('.apps-error-msg h2', opt.domContext).text(errSummary);
|
||||
$('.apps-error-msg p', opt.domContext).text(errMessage);
|
||||
$(opt.domContext).trigger('error_shown.apps');
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
})(typeof exports === 'undefined' ? (this.apps = {}) : exports);
|
||||
|
|
|
@ -136,7 +136,8 @@
|
|||
if (classes.webapp) {
|
||||
install(attr.manifest_url, {
|
||||
url: href,
|
||||
el: activeInstaller[0]
|
||||
el: el,
|
||||
mobile: true
|
||||
});
|
||||
} else {
|
||||
install(attr.name, href, attr.icon, hash);
|
||||
|
|
Загрузка…
Ссылка в новой задаче