Commit 6dac3a53 authored by Timo Tegtmeier's avatar Timo Tegtmeier

Now stopping event bubbling properly

parent 63b63b22
......@@ -232,7 +232,8 @@ enyo.kind({
openAppMenu: function(sender, event) {
this.doOpenAppMenu(event);
},
return true;
},
//
// List handling
......@@ -276,7 +277,8 @@ enyo.kind({
this.$.reorderFeedURL.applyStyle("font-size", enyo.application.prefs.largeFont ? "16px" : "14px");
this.$.reorderFeedURL.setContent(enyo.application.feeds.getFeedURL(feed));
this.$.reorderFeedIcon.setSrc(enyo.application.feeds.getFeedIcon(feed));
},
return true;
},
isItemSwipeable: function(sender, event) {
var index;
......@@ -288,7 +290,8 @@ enyo.kind({
listPulled: function() {
enyo.Signals.send("onUpdateAll");
},
return true;
},
acquireData: function(filter, inserter) {
enyo.application.feeds.getFeeds(filter, inserter);
......@@ -331,7 +334,7 @@ enyo.kind({
isLast: event.index == (this.items.length - 1)
});
}
},
},
beforeShowFeedMenu: function(sender, event) {
// Store the menu index.
......@@ -341,7 +344,9 @@ enyo.kind({
var isEditable = (feed.feedType != feedTypes.ftStarred) && (feed.feedType != feedTypes.ftAllItems);
this.$.itemEditFeed.setShowing(isEditable);
this.$.itemDeleteFeed.setShowing(isEditable);
},
return true;
},
itemDeleted: function(sender, index) {
if(this.swipedIndex === undefined)
......@@ -373,7 +378,7 @@ enyo.kind({
this.spinningIndex = state ? index : -1;
this.$.list.lockRow(index);
}
},
},
//
// Menu handling
......@@ -381,26 +386,32 @@ enyo.kind({
menuMarkAllRead: function(sender, event) {
enyo.application.feeds.markAllRead(this.items[this.menuIndex]);
return true;
},
menuMarkAllUnRead: function(sender, event) {
enyo.application.feeds.markAllUnRead(this.items[this.menuIndex]);
return true;
},
menuMarkAllUnStarred: function(sender, event) {
enyo.application.feeds.markAllUnStarred(this.items[this.menuIndex]);
return true;
},
menuEditFeed: function(sender, event) {
this.doEditFeed(this.items[this.menuIndex]);
return true;
},
menuUpdateFeed: function(sender, event) {
enyo.application.feeds.enqueueUpdate(this.items[this.menuIndex]);
return true;
},
menuDeleteFeed: function(sender, event) {
this.itemDeleted(sender, this.menuIndex);
return true;
},
//
......@@ -409,10 +420,12 @@ enyo.kind({
addFeedClicked: function(sender, event) {
this.doAddFeed();
return true;
},
refreshClicked: function(sender, event) {
enyo.Signals.send("onUpdateAll");
return true;
},
//
......@@ -422,12 +435,14 @@ enyo.kind({
showSearchBox: function() {
this.$.appMenuButton.hide();
this.inherited(arguments);
return true;
},
hideSearchBox: function() {
if(this.$.searchBox.getShowing())
this.$.appMenuButton.show();
this.inherited(arguments);
return true;
},
//
......
......@@ -120,6 +120,7 @@ enyo.kind({
case 1: this.$.storyList.resized(); break;
case 2: this.$.storyView.resized(); break;
}
return true;
},
//
......@@ -128,6 +129,7 @@ enyo.kind({
openAppMenu: function(sender, event) {
enyo.openMenuAtEvent(this.$.mainMenu, this, event);
return true;
},
feedSelected: function(sender, event) {
......@@ -151,18 +153,21 @@ enyo.kind({
});
}
});
return true;
},
addFeed: function(sender) {
enyo.asyncMethod(this, function() {
this.$.editFeedDialog.show(null);
});
return true;
},
editFeed: function(sender, feed) {
enyo.asyncMethod(this, function() {
this.$.editFeedDialog.show(feed);
});
return true;
},
//
......@@ -187,6 +192,7 @@ enyo.kind({
});
}
});
return true;
},
//
......@@ -197,12 +203,14 @@ enyo.kind({
enyo.asyncMethod(this, function() {
this.$.mainPane.setIndex(0);
});
return true;
},
backToStoryList: function() {
enyo.asyncMethod(this, function() {
this.$.mainPane.setIndex(1);
});
return true;
},
//
......@@ -211,19 +219,22 @@ enyo.kind({
selectNextFeed: function() {
this.$.feedList.selectNext();
return true;
},
selectPrevFeed: function() {
this.$.feedList.selectPrev();
return true;
},
selectNextStory: function() {
this.$.storyList.selectNext();
return true;
},
selectPrevStory: function() {
this.$.storyList.selectPrev();
return true;
},
//
......@@ -235,6 +246,7 @@ enyo.kind({
this.$.preferences.reInitialize();
this.$.outerPane.setIndex(1);
});
return true;
},
openImporter: function() {
......@@ -242,18 +254,21 @@ enyo.kind({
this.$.feedImporter.reInitialize();
this.$.outerPane.setIndex(2);
});
return true;
},
openHelp: function() {
enyo.asyncMethod(this, function() {
this.$.helpDialog.show();
});
return true;
},
openLicense: function() {
enyo.asyncMethod(this, function() {
this.$.licenseDialog.show();
});
return true;
},
//
......@@ -262,6 +277,7 @@ enyo.kind({
prefsSaved: function() {
this.fullRefresh();
return true;
},
//
......@@ -270,6 +286,7 @@ enyo.kind({
importerClosed: function() {
this.fullRefresh();
return true;
},
//
......@@ -285,15 +302,19 @@ enyo.kind({
if(firstActivation && enyo.application.db.isReady) {
this.dbReady();
}
return true;
},
windowDeActivated: function() {
enyo.application.isActive = false;
return true;
},
unloaded: function() {
enyo.application.spooler.aboutToClose();
enyo.application.mainView = undefined;
return true;
},
//
......@@ -313,6 +334,7 @@ enyo.kind({
enyo.asyncMethod(this, function() {
this.$.errorDialog.show(msg);
});
return true;
},
//
......@@ -343,7 +365,7 @@ enyo.kind({
rendered: function() {
this.resized();
this.inherited(arguments);
return this.inherited(arguments);
},
initComponents: function() {
......
......@@ -348,15 +348,19 @@ enyo.kind({
this.resized();
this.updateOnly = false;
return true;
},
noConnection: function() {
this.$.picture.hide();
this.$.loadSpinner.hide();
return true;
},
pictureLoaded: function() {
this.$.loadSpinner.hide();
return true;
},
linkClicked: function(sender, event) {
......@@ -365,12 +369,14 @@ enyo.kind({
} else if(this.urls.length > 1) {
// show a menu
}
return true;
},
handleClick: function(href) {
if(!this._scrolling) {
enyo.application.openLink(href);
}
return true;
},
//
......@@ -432,11 +438,13 @@ enyo.kind({
var mediaControl = this.getMediaControl();
var position = mediaControl.getDuration() * this.$.mediaSlider.getValue() / 1000;
mediaControl.seek(position);
return true;
},
mediaSeeked: function() {
this.mediaSeeking();
this._mediaSeeking = false;
return true;
},
mediaPlayToggled: function(sender) {
......@@ -452,11 +460,12 @@ enyo.kind({
this.setMediaTimer(true);
}
});
return true;
},
mediaStateChanged: function(sender) {
if(!this.story)
return;
return true;
try {
this.$.mediaState.setContent(sender.getReadableState());
......@@ -469,18 +478,20 @@ enyo.kind({
} catch(e) {
this.log("STATE CHANGED EX>", e);
}
return true;
},
mediaCanPlay: function(sender) {
if(!this.story)
return;
return true;
this.$.mediaPlayButton.setDisabled(false);
return true;
},
mediaProgress: function(sender) {
if(!this.story)
return;
return true;
var buffered = sender.getBuffered();
var duration = sender.getDuration();
......@@ -488,6 +499,7 @@ enyo.kind({
if(!this._mediaSeeking && buffered && duration) {
this.$.mediaSlider.animateProgressTo(Math.round(buffered.end(0) * 1000 / duration));
}
return true;
},
mediaUpdate: function(sender) {
......@@ -504,6 +516,7 @@ enyo.kind({
}
}
this.setMediaTimer(true);
return true;
},
setMediaTimer: function(active) {
......@@ -537,11 +550,13 @@ enyo.kind({
storyStarred: function() {
this.story.isStarred = this.$.starButton.getChecked();
enyo.application.feeds.markStarred(this.story);
return true;
},
shareClicked: function(sender, event) {
this.$.shareViaIMItem.setShowing(enyo.application.helper.canShareViaIM);
enyo.openMenuAtEvent(this.$.shareMenu, sender, event);
return true;
},
//
......@@ -556,6 +571,7 @@ enyo.kind({
this.urls[i].title + '</a>';
}
enyo.application.openEMail($L("Check out this story"), text);
return true;
},
shareViaIM: function(sender, email) {
......@@ -564,6 +580,7 @@ enyo.kind({
text += (i > 0 ? ", " : "") + this.urls[i].href;
}
enyo.application.openMessaging(text);
return true;
},
//
......
......@@ -339,7 +339,7 @@ enyo.kind({
isFirst: event.index == 0,
isLast: event.index == (this.items.length - 1)
});
},
},
storyStarred: function(sender, event) {
var story = this.items[event.rowIndex];
......@@ -355,7 +355,8 @@ enyo.kind({
isLast: this.selectedIndex == (this.items.length - 1)
});
}
},
return true;
},
//
// Ordering and filtering
......@@ -381,7 +382,8 @@ enyo.kind({
}
enyo.openMenuAtEvent(this.$.sortMenu, sender, event);
},
return true;
},
setSortMode: function(value) {
this.feed.sortMode = value;
......@@ -390,19 +392,23 @@ enyo.kind({
showAll: function() {
this.setSortMode((this.feed.sortMode & 0xFF00) | 0);
},
return true;
},
showUnRead: function() {
this.setSortMode((this.feed.sortMode & 0xFF00) | 1);
},
return true;
},
showNew: function() {
this.setSortMode((this.feed.sortMode & 0xFF00) | 2);
},
return true;
},
orderToggled: function() {
this.setSortMode(this.feed.sortMode ^ 0x0100);
},
return true;
},
//
// Toolbar handling
......@@ -412,12 +418,14 @@ enyo.kind({
if(this.feed) {
enyo.application.feeds.enqueueUpdate(this.feed);
}
},
return true;
},
shareClicked: function(sender, event) {
this.$.shareViaIMItem.setShowing(enyo.application.helper.canShareViaIM);
enyo.openMenuAtEvent(this.$.shareMenu, sender, event);
},
return true;
},
//
// Sharing
......@@ -477,11 +485,11 @@ enyo.kind({
}
this.refresh();
this.resized();
},
},
isLastFeedChanged: function() {
this.$.nextFeedButton.setDisabled(this.isLastFeed);
},
},
isFirstFeedChanged: function() {
this.$.prevFeedButton.setDisabled(this.isFirstFeed);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment