Skip to content

Commit

Permalink
Merge branch 'fix/1619' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
Lionel Laské committed May 12, 2024
2 parents c9cc0f1 + cbae7bf commit f048a60
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
- Localization error in FoodChain #1608
- Alignment issue in Abacus #1607
- Blank screen on iOS when opening a PDF #1618
- Journal instance pop up remain after launching a PDF or an external app #1619

## [1.8.0] - 2024-04-10
### Added
Expand Down
13 changes: 10 additions & 3 deletions js/homeview.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ enyo.kind({
this.restrictedModeInfo = { start: 0 };
util.hideNativeToolbar();
this.tutorialActivity = null;
this.forbiddenActivity = null;
this.eeMode = null;

// Load and sort journal
Expand Down Expand Up @@ -546,7 +547,7 @@ enyo.kind({
util.vibrate();
var help = activity.id == tutorial.activityId;
preferences.runActivity(activity, undefined, null, null, help);
this.postRunActivity(activity.isNative);
this.postRunActivity(activity.id, activity.isNative);
},
runOldActivity: function(activity, instance) {
// Run an old activity instance
Expand All @@ -561,12 +562,14 @@ enyo.kind({
util.vibrate();
var help = tutorial.isLaunched() && activity.id == tutorial.activityId;
preferences.runActivity(activity, null, null, null, help);
this.postRunActivity(activity.isNative);
this.postRunActivity(activity.id, activity.isNative);
},
postRunActivity: function(isNative) {
postRunActivity: function(id, isNative) {
// When run a native activity, should update journal and view to reflect journal change
if (window.sugarizerOS && isNative) {
sugarizerOS.popupTimer = new Date();
this.getPopup().hidePopup();
this.forbiddenActivity = id;
this.loadJournal();
activities.loadEntries();
this.draw();
Expand All @@ -582,12 +585,16 @@ enyo.kind({
showActivityPopup: function(icon) {
// Create popup
if (window.sugarizerOS) {
if (this.forbiddenActivity && this.forbiddenActivity == icon.icon.id) {
return;
}
var now = new Date();
if (sugarizerOS.popupTimer && now.getTime() - sugarizerOS.popupTimer.getTime() < 3000) {
return;
}
sugarizerOS.popupTimer = now;
}
this.forbiddenActivity = null;
var title;
var activity = icon.icon; // HACK: activity is stored as an icon
if (activity.instances !== undefined && activity.instances.length > 0 && activity.instances[0].metadata.title !== undefined) {
Expand Down
6 changes: 6 additions & 0 deletions js/journal.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ enyo.kind({
this.journalType = constant.journalLocal;
this.smallTime = false;
this.dialogAction = -1;
this.forbiddenObjectId = null;
this.journalChanged();
this.$.footer.setShowing(preferences.getNetworkId() != null && preferences.getPrivateJournal() != null && preferences.getSharedJournal() != null);
if (l10n.language.direction == "rtl") {
Expand Down Expand Up @@ -474,6 +475,7 @@ enyo.kind({
var that = this;
this.loadEntry(activity, function(err, metadata, text) {
that.$.activityPopup.hidePopup();
that.forbiddenObjectId = activity.objectId; // To avoid display of the popup
util.openAsDocument(metadata, text, activity.objectId);
return;
});
Expand Down Expand Up @@ -619,6 +621,10 @@ enyo.kind({
if (!icon.owner) {
return;
}
if (this.forbiddenObjectId && icon.data && icon.data.objectId == this.forbiddenObjectId) {
return;
}
this.forbiddenObjectId = null;
var activity = icon.icon; // HACK: activity is stored as an icon
var entry = icon.getData();
var title = null;
Expand Down
6 changes: 6 additions & 0 deletions js/listview.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ enyo.kind({
this.scrollbar_session_value = 0;
this.scroll_count = 0;
this.favoriteActivityButton = null;
this.forbiddenActivity = null;
if (!window.sugarizerOS) {
this.activitiesChanged();
this.computeSize();
Expand Down Expand Up @@ -207,12 +208,17 @@ enyo.kind({
// Start a new activity instance
util.vibrate();
this.$.activityPopup.hidePopup();
this.forbiddenActivity = activity.id;
preferences.runActivity(activity, null);
},

// Popup menu handling
showActivityPopup: function(icon) {
// Create popup
if (window.sugarizerOS && this.forbiddenActivity && this.forbiddenActivity == icon.icon.id) {
return;
}
this.forbiddenActivity = null;
var activity = icon.icon;
this.$.activityPopup.setHeader({
icon: activity,
Expand Down

0 comments on commit f048a60

Please sign in to comment.