Skip to content
This repository has been archived by the owner on Nov 3, 2021. It is now read-only.

Commit

Permalink
Merge pull request #67 from mozilla-b2g/ato/bug-996321/1
Browse files Browse the repository at this point in the history
Bug 996321 - Position prompt dialog at the centre of the viewport
  • Loading branch information
Rob Wood committed Apr 22, 2014
2 parents d91f001 + 15c7fc5 commit 94ef916
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 29 deletions.
12 changes: 7 additions & 5 deletions webapi_tests/semiauto/static/app.html
Expand Up @@ -30,15 +30,17 @@ <h1>Test Runner</h1>
</tr>
</table>

<div id="overlay" class="overlay hidden">
<div class="dialog_box">
<p id="dialog_text"></p>
<div id="dialog" class="hidden">
<div>
<div class="content">
<p id="dialog_text"></p>
</div>

<p>
<div class="controls">
<input type="text" id="dialog_response" />
<button id="ok">OK</button>
<button id="cancel">Cancel</button>
</p>
</div>
</div>
</div>
</div>
Expand Down
14 changes: 7 additions & 7 deletions webapi_tests/semiauto/static/app.js
Expand Up @@ -101,11 +101,11 @@ TestListView.prototype = {
// confirmation will show a dialogue with a question, and two buttons:
// "Yes" and "No".
function Dialog(msg, type) {
this.overlayEl = $("#overlay");
this.textEl = $("#dialog_text");
this.responseEl = $("#dialog_response");
this.okEl = $("#ok");
this.cancelEl = $("#cancel");
this.el = $("#dialog");
this.textEl = $("#dialog .content");
this.responseEl = $("#dialog .controls input[type=text]");
this.okEl = $("#dialog .controls #ok");
this.cancelEl = $("#dialog .controls #cancel");

this.okEl.onclick = function() { this.onok(); this.close(); }.bind(this);
this.cancelEl.onclick = function() { this.oncancel(); this.close(); }.bind(this);
Expand All @@ -130,7 +130,7 @@ function Dialog(msg, type) {
Dialog.prototype = {
show: function() {
this.textEl.innerHTML = this.message;
this.overlayEl.removeClass("hidden");
this.el.removeClass("hidden");

switch (this.type) {
case "instruct":
Expand All @@ -144,7 +144,7 @@ Dialog.prototype = {
},

close: function() {
this.overlayEl.addClass("hidden");
this.el.addClass("hidden");
this.reset();
},

Expand Down
36 changes: 19 additions & 17 deletions webapi_tests/semiauto/static/look.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 94ef916

Please sign in to comment.