Permalink
Browse files

Dialog styling

Pagecreate event
Init code for jQuery mobile
  • Loading branch information...
1 parent 24ab43b commit 476b8f0b1bd6e39f768716c40ac4fab3d1f1c79e @gbraad gbraad committed Jun 12, 2012
Showing with 34 additions and 1 deletion.
  1. +12 −1 code.js
  2. +2 −0 index.html
  3. +5 −0 init.js
  4. +15 −0 styling.css
View
13 code.js
@@ -105,7 +105,18 @@ function getObject(key) {
}
// Main function
-$(function () {
+$(document).bind('pagecreate', function() {
+ //new GAuth.Controller();
+
+ // Background styling for dialogs
+ $('div[data-role="dialog"]').live('pagebeforeshow', function(e, ui) {
+ ui.prevPage.addClass("ui-dialog-background");
+ });
+
+ $('div[data-role="dialog"]').live('pagehide', function(e, ui) {
+ $(".ui-dialog-background ").removeClass("ui-dialog-background");
+ });
+
// Check if local storage is supported
if (typeof (Storage) !== "undefined") {
if (!getObject('accounts')) {
View
2 index.html
@@ -2,10 +2,12 @@
<head>
<title>GAuth Authenticator</title>
<script src="jquery-1.7.2.min.js"></script>
+ <script src="init.js"></script>
<script src="jquery.mobile-1.1.0.min.js"></script>
<script src="sha.js"></script>
<script src="code.js"></script>
<link rel="stylesheet" href="jquery.mobile-1.1.0.min.css" />
+ <link rel="stylesheet" href="styling.css" />
</head>
<body>
<div data-role="page" id="main">
View
5 init.js
@@ -0,0 +1,5 @@
+// Init function
+$(document).bind('mobileinit', function(){
+ $.mobile.defaultPageTransition = 'none';
+ $.mobile.defaultDialogTransition = 'none';
+});
View
15 styling.css
@@ -0,0 +1,15 @@
+.ui-dialog-background {
+ opacity: 0.5;
+ display: block !important;
+ -webkit-transition: opacity 0.5s ease-in;
+}
+
+.ui-dialog-background.pop.in {
+ opacity: 1;
+ -webkit-transition: opacity 0.5s ease-in;
+}
+
+.ui-dialog {
+ min-height: 100% !important;
+ background: transparent !important;
+}

0 comments on commit 476b8f0

Please sign in to comment.