summaryrefslogtreecommitdiff
path: root/UICaboodle/RVBook.mm
diff options
context:
space:
mode:
authorJay Freeman (saurik) <saurik@saurik.com>2009-02-28 08:01:19 +0000
committerJay Freeman (saurik) <saurik@saurik.com>2010-09-30 07:09:49 +0000
commit2f3ef0b1c552a81965deb2cadc67461090b1d122 (patch)
tree64d9ec1487b2956f227b5b527130a9689b638694 /UICaboodle/RVBook.mm
parent4fbb376e9fdb89b3053affeace69bef529d140a1 (diff)
Fixed the weird zoom-related sizing bug I had accumulated on the Facebook login page, set up the connection to support the page resetting the viewport width, and finally implemented active page swapping: you can now replace a document with a cydia:// URL (so you need target=_blank more often to get the old behavior).
Diffstat (limited to 'UICaboodle/RVBook.mm')
-rw-r--r--UICaboodle/RVBook.mm25
1 files changed, 21 insertions, 4 deletions
diff --git a/UICaboodle/RVBook.mm b/UICaboodle/RVBook.mm
index b639958..d7a3949 100644
--- a/UICaboodle/RVBook.mm
+++ b/UICaboodle/RVBook.mm
@@ -135,10 +135,22 @@
[navbar_ enableAnimation];
}
-- (void) pushPage:(RVPage *)page {
- if ([pages_ count] != 0)
- [[pages_ lastObject] setPageActive:NO];
+- (void) swapPage:(RVPage *)page {
+ if ([pages_ count] == 0)
+ return [self pushPage:page];
+
+ [[pages_ lastObject] setPageActive:NO];
+
+ [navbar_ disableAnimation];
+ resetting_ = true;
+ [navbar_ popNavigationItem];
+ resetting_ = false;
+ [self pushPage:page animated:NO];
+ [navbar_ enableAnimation];
+}
+
+- (void) pushPage:(RVPage *)page animated:(BOOL)animated {
NSString *title = [self getTitleForPage:page];
NSString *backButtonTitle = [page backButtonTitle];
@@ -149,7 +161,6 @@
[navitem setBackButtonTitle:backButtonTitle];
[navbar_ pushNavigationItem:navitem];
- BOOL animated = [pages_ count] == 0 ? NO : YES;
[page setFrame:[transition_ bounds]];
[transition_ transition:(animated ? 1 : 0) toView:page];
[page setPageActive:YES];
@@ -160,6 +171,12 @@
[navbar_ setAccessoryView:[page accessoryView] animate:animated removeOnPop:NO];
}
+- (void) pushPage:(RVPage *)page {
+ if ([pages_ count] != 0)
+ [[pages_ lastObject] setPageActive:NO];
+ [self pushPage:page animated:([pages_ count] == 0 ? NO : YES)];
+}
+
- (void) pushBook:(RVBook *)book {
[delegate_ popUpBook:book];
}