From 74de81c9cd298f21399457624c5948743e6874c7 Mon Sep 17 00:00:00 2001 From: Adam Bradley Date: Mon, 26 Aug 2013 13:09:13 -0500 Subject: [PATCH] started pull to refresh --- dist/framework-with-theme.css | 17 +++++++++++++- example/pull-to-refresh.html | 9 ++++++-- scss/framework-structure.scss | 3 ++- scss/framework-theme-default.scss | 1 + scss/framework/structure/_bar.scss | 2 +- .../framework/structure/_pull-to-refresh.scss | 22 +++++++++++++++++++ .../theme/default/_pull-to-refresh.scss | 4 ++++ 7 files changed, 53 insertions(+), 5 deletions(-) create mode 100644 scss/framework/structure/_pull-to-refresh.scss create mode 100644 scss/framework/theme/default/_pull-to-refresh.scss diff --git a/dist/framework-with-theme.css b/dist/framework-with-theme.css index c73ba6ff50..96144c58e3 100644 --- a/dist/framework-with-theme.css +++ b/dist/framework-with-theme.css @@ -66,6 +66,18 @@ main > * { .show { display: block; } +.ptr-capable { + -webkit-user-drag: element; } + +.ptr-content { + position: fixed; + top: 0; + right: 0; + bottom: 0; + left: 0; + overflow: auto; + height: 0; } + .button { position: relative; display: block; @@ -129,7 +141,7 @@ main > * { /* Pad top/bottom of content so it doesn't hide behind .bar-title and .bar-tab. Note: For these to work, content must come after both bars in the markup */ -.bar-header ~ main { +.bar-header ~ main, .has-header { top: 50px; } .has-footer { @@ -487,3 +499,6 @@ a.list-item { a.list-item { color: #333333; } + +.ptr-content { + background: #eee; } diff --git a/example/pull-to-refresh.html b/example/pull-to-refresh.html index c08adb06b3..e3397b1b0a 100644 --- a/example/pull-to-refresh.html +++ b/example/pull-to-refresh.html @@ -17,10 +17,15 @@

Pull To Refresh

-
- +
+

Pull the content down to refresh.

+
+
KEEP GOING
+
REFRESHING!
+
+ diff --git a/scss/framework-structure.scss b/scss/framework-structure.scss index 42cbac9a34..9e0d2c7401 100755 --- a/scss/framework-structure.scss +++ b/scss/framework-structure.scss @@ -9,12 +9,13 @@ "framework/structure/alerts", "framework/structure/base", + "framework/structure/pull-to-refresh", + "framework/structure/button", "framework/structure/bar", "framework/structure/tabs", - "framework/structure/button-group", "framework/structure/form", diff --git a/scss/framework-theme-default.scss b/scss/framework-theme-default.scss index a325f00f34..d96de88200 100755 --- a/scss/framework-theme-default.scss +++ b/scss/framework-theme-default.scss @@ -10,4 +10,5 @@ "framework/theme/default/button", "framework/theme/default/icon", "framework/theme/default/listview", + "framework/theme/default/pull-to-refresh", "framework/theme/default/table"; diff --git a/scss/framework/structure/_bar.scss b/scss/framework/structure/_bar.scss index 7b85f4ebb4..6fc0bcdfac 100644 --- a/scss/framework/structure/_bar.scss +++ b/scss/framework/structure/_bar.scss @@ -75,7 +75,7 @@ /* Pad top/bottom of content so it doesn't hide behind .bar-title and .bar-tab. Note: For these to work, content must come after both bars in the markup */ -.bar-header ~ main { +.bar-header ~ main, .has-header { top: $barHeight; } diff --git a/scss/framework/structure/_pull-to-refresh.scss b/scss/framework/structure/_pull-to-refresh.scss new file mode 100644 index 0000000000..9ba193cebb --- /dev/null +++ b/scss/framework/structure/_pull-to-refresh.scss @@ -0,0 +1,22 @@ + +.ptr-capable { + -webkit-user-drag: element; +} + +.ptr-content { + position: fixed; + top: 0; + right: 0; + bottom: 0; + left: 0; + overflow: auto; + height: 0; +} + +.ptr-content .pulling { + display: none; +} + +.ptr-content .refreshing { + display: none; +} \ No newline at end of file diff --git a/scss/framework/theme/default/_pull-to-refresh.scss b/scss/framework/theme/default/_pull-to-refresh.scss new file mode 100644 index 0000000000..52d8698997 --- /dev/null +++ b/scss/framework/theme/default/_pull-to-refresh.scss @@ -0,0 +1,4 @@ + +.ptr-content { + background: #eee; +} \ No newline at end of file