diff --git a/babybuddy/static_src/js/babybuddy.js b/babybuddy/static_src/js/babybuddy.js
index c77ad7f8..8c34571c 100644
--- a/babybuddy/static_src/js/babybuddy.js
+++ b/babybuddy/static_src/js/babybuddy.js
@@ -9,15 +9,19 @@ if (typeof moment === 'undefined') {
* Baby Buddy Namespace
*
* Default namespace for the Baby Buddy app.
+ *
+ * @type {{}}
*/
var BabyBuddy = function () {
return {};
}();
/**
- * Baby Buddy Datetime Picker
+ * Datetime Picker.
*
* Provides modifications and defaults for the base datetime picker widget.
+ *
+ * @type {{init: BabyBuddy.DatetimePicker.init}}
*/
BabyBuddy.DatetimePicker = function ($, moment) {
return {
@@ -35,3 +39,23 @@ BabyBuddy.DatetimePicker = function ($, moment) {
}
};
}(jQuery, moment);
+
+/**
+ * Pull to refresh.
+ *
+ * @type {{init: BabyBuddy.PullToRefresh.init, onRefresh: BabyBuddy.PullToRefresh.onRefresh}}
+ */
+BabyBuddy.PullToRefresh = function(ptr) {
+ return {
+ init: function () {
+ ptr.init({
+ mainElement: 'body',
+ onRefresh: this.onRefresh
+ });
+ },
+
+ onRefresh: function() {
+ window.location.reload();
+ }
+ };
+}(PullToRefresh);
diff --git a/babybuddy/static_src/scss/global.scss b/babybuddy/static_src/scss/global.scss
index fac2f569..d388ee2a 100644
--- a/babybuddy/static_src/scss/global.scss
+++ b/babybuddy/static_src/scss/global.scss
@@ -59,4 +59,13 @@
}
}
}
-}
\ No newline at end of file
+}
+
+// PullToRefresh elements.
+.ptr--ptr {
+ background: theme-color('dark');
+ .ptr--text, .ptr--icon {
+ // "!important" must be used to override inline styling from JS.
+ color: theme-color('light') !important;
+ }
+}
diff --git a/babybuddy/templates/babybuddy/base.html b/babybuddy/templates/babybuddy/base.html
index 1e17537e..7a3d4bd5 100644
--- a/babybuddy/templates/babybuddy/base.html
+++ b/babybuddy/templates/babybuddy/base.html
@@ -43,6 +43,9 @@
+ {% if user.is_authenticated %}
+
+ {% endif %}
{% block javascript %}{% endblock %}