diff options
author | Catalin Badea <catalin.badea392@gmail.com> | 2012-08-01 10:55:21 (GMT) |
---|---|---|
committer | Catalin Badea <catalin.badea392@gmail.com> | 2012-08-01 10:55:21 (GMT) |
commit | ddd4265b65c4a523d6f86abf6cad8fcda16be021 (patch) | |
tree | 07308a4bff15198844be1bc217d9533b7fb68c5d /Swift/Controllers | |
parent | 2fe9c9f3952b5ab6b8a158233deda8a89fe0b589 (diff) | |
download | swift-contrib-ddd4265b65c4a523d6f86abf6cad8fcda16be021.zip swift-contrib-ddd4265b65c4a523d6f86abf6cad8fcda16be021.tar.bz2 |
Fix javascript autoscrolling.
Diffstat (limited to 'Swift/Controllers')
-rw-r--r-- | Swift/Controllers/HistoryViewController.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/Swift/Controllers/HistoryViewController.cpp b/Swift/Controllers/HistoryViewController.cpp index 57b331b..819ba4e 100644 --- a/Swift/Controllers/HistoryViewController.cpp +++ b/Swift/Controllers/HistoryViewController.cpp @@ -163,6 +163,10 @@ void HistoryViewController::handleReturnPressed(const std::string& keyword) { } void HistoryViewController::handleScrollReachedTop(const boost::gregorian::date& date) { + if (!selectedItem_) { + return; + } + std::vector<HistoryMessage> messages = historyController_->getMessagesFromPreviousDate(selfJID_, selectedItem_->getJID(), selectedItemType_, date); foreach (const HistoryMessage& message, messages) { @@ -172,6 +176,10 @@ void HistoryViewController::handleScrollReachedTop(const boost::gregorian::date& } void HistoryViewController::handleScrollReachedBottom(const boost::gregorian::date& date) { + if (!selectedItem_) { + return; + } + std::vector<HistoryMessage> messages = historyController_->getMessagesFromNextDate(selfJID_, selectedItem_->getJID(), selectedItemType_, date); foreach (const HistoryMessage& message, messages) { |