Skip to content
This repository has been archived by the owner on Nov 3, 2021. It is now read-only.

Commit

Permalink
Merge pull request #12533 from EverythingMe/912386-apps-hold-click
Browse files Browse the repository at this point in the history
[Bug 912386] fix long-tap on app won't prevent normal click [r=crdlc]
  • Loading branch information
amirnissim committed Sep 30, 2013
2 parents 3b22ac5 + ff950a9 commit e7c0113
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
13 changes: 11 additions & 2 deletions apps/homescreen/everything.me/js/Brain.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
CLASS_WHEN_HAS_QUERY = 'evme-has-query',
CLASS_WHEN_COLLECTION_VISIBLE = 'evme-collection-visible',
CLASS_WHEN_LOADING_SHORTCUTS_SUGGESTIONS = 'evme-suggest-collections-loading',
CLASS_WHEN_SAVING_TO_HOMESCREEN = 'save-to-homescreen',

L10N_SYSTEM_ALERT = 'alert',

Expand Down Expand Up @@ -672,20 +673,28 @@ this.InstalledAppsService = new function InstalledAppsService() {
}

function saveToHomescreen(data, showConfirm) {
var isAppInstalled = EvmeManager.isAppInstalled(data.app.getFavLink());
var isAppInstalled = EvmeManager.isAppInstalled(data.app.getFavLink()),
classList = data.el.classList;

if (isAppInstalled) {
classList.add(CLASS_WHEN_SAVING_TO_HOMESCREEN);
window.alert(Evme.Utils.l10n(L10N_SYSTEM_ALERT, 'app-install-exists', {
'name': data.data.name
}));
classList.remove(CLASS_WHEN_SAVING_TO_HOMESCREEN);
return;
}

if (showConfirm) {
var msg = Evme.Utils.l10n(L10N_SYSTEM_ALERT, 'app-install-confirm', {
'name': data.data.name
});
if (!window.confirm(msg)) {

classList.add(CLASS_WHEN_SAVING_TO_HOMESCREEN);
var saved = window.confirm(msg);
classList.remove(CLASS_WHEN_SAVING_TO_HOMESCREEN);

if (!saved) {
return;
}
}
Expand Down
6 changes: 5 additions & 1 deletion apps/homescreen/everything.me/modules/Results/Results.css
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,14 @@
position: relative; /* for span.remove positioning */
}

.evmeScope .evme-apps ul.marketapps li{
.evmeScope .evme-apps ul.marketapps li {
height: 9.3rem;
}

.evmeScope .evme-apps ul li.save-to-homescreen {
pointer-events: none;
}

.evmeScope .evme-apps:not(.has-installed) .has-installed-visible {
display: none;
}
Expand Down

0 comments on commit e7c0113

Please sign in to comment.