~ubuntu-branches/ubuntu/trusty/ubuntu-html5-theme/trusty-proposed

« back to all changes in this revision

Viewing changes to 0.1/ambiance/js/dialogs.js

  • Committer: Package Import Robot
  • Author(s): Ubuntu daily release, Adnane Belmadiaf, daker, Kyle Nitzsche, Colin Watson, Alexandre Abreu, Ubuntu daily release
  • Date: 2014-01-07 23:46:53 UTC
  • mfrom: (1.1.7)
  • Revision ID: package-import@ubuntu.com-20140107234653-oagvm6guom4h9dvh
Tags: 0.1+14.04.20140107-0ubuntu1
[ Adnane Belmadiaf ]
* s/parentNode/parendNode Spaces instead of tabs. (LP: #1241215)
* Add option selector widget. (LP: #1232533)

[ daker ]
* Passe the UI variable name so we will not lock the variable. (LP:
  #1222878)
* Made variable declaration locale. (LP: #1222881)
* Fixed z-index for the list items aside. (LP: #1223973)
* s/parentNode/parendNode Spaces instead of tabs. (LP: #1241215)
* Space instead of tab. (LP: #1240682)
* Made list items with headers differentes. (LP: #1246446)
* Updated the progressbar component to match the design.
* Move tabs closer to what they should be, Expand API to match the QML
  one (at least at the Tabs level), .
* Add option selector widget. (LP: #1232533)

[ Kyle Nitzsche ]
* Add button id to "Invalid button ID" error message .
* This MR does three main things: 1) Implements yuidoc comments in all
  js files to support API doc generation, and provides yuidoc assets
  (theme dir and json file) needed to build the API docs. Bug LP:
  #1241029 3) Provides JS classes for shape and page with
  corresponding UbuntuUI prototype constructor functions. Bug LP:
  #1243248 4) Adds a getEl(UbuntuUIObject) to return the element for
  any Ubuntu class. Also LP: #1243248. (LP: #1243248, #1241029)

[ Colin Watson ]
* Make ubuntu-html5-theme Multi-Arch: foreign.

[ Alexandre Abreu ]
* Fix exec path in app-gallery app desktop file. (LP: #1235321)
* Add convenient element() function to most widgets ... (we might want
  to factor those out in a second step).
* Move tabs closer to what they should be, Expand API to match the QML
  one (at least at the Tabs level), .
* Add HTML5 webapp container package.

[ Ubuntu daily release ]
* Automatic snapshot from revision 98

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
 * <http://www.gnu.org/licenses/>.
21
21
 */
22
22
 
23
 
/* Dialogs */
 
23
/**
 
24
 * Dialogs are modal full-screen popups that prevent other GUI interactions with the application until dismissed.
 
25
 
 
26
Dialogs wrap arbitrary markup.
 
27
 
 
28
Dialogs are declared inside the <em>content</em> div as a sibling to the <em>pagestack</em> div.
 
29
 * @class Dialog
 
30
 * @constructor
 
31
 * @namespace UbuntuUI
 
32
 * @example
 
33
      <div data-role="content">
 
34
        <div data-role="pagestack">
 
35
          [...]
 
36
        </div>
 
37
        <div data-role="dialog" id="dialogID">
 
38
          [...]
 
39
        </div>
 
40
      </div>
 
41
 
 
42
      JavaScript access:
 
43
      var dialog = UI.dialog("dialogID");
 
44
 
 
45
 */
24
46
var Dialog = function (id) {
 
47
    this.id = id;
25
48
    this.dialog = document.getElementById(id);
26
49
};
27
50
 
28
51
Dialog.prototype = {
 
52
    /**
 
53
     * Display a dialog by adding 'active' CSS class
 
54
     * @method show
 
55
     */
29
56
    show: function () {
30
57
        this.dialog.classList.add('active');
31
58
    },
 
59
    /**
 
60
     * Hide a dialog by removing 'active' class
 
61
     * @method hide
 
62
     */
32
63
    hide: function () {
33
64
        this.dialog.classList.remove('active');
34
65
    },
 
66
    /**
 
67
     * Toggle a dialog, which means removing its 'active' class if it has one, or adding the 'active' class if it does not have one
 
68
     * @method toggle
 
69
     */
35
70
    toggle: function () {
36
71
        this.dialog.classList.toggle('active');
 
72
    },
 
73
    /**
 
74
     * Returns the DOM element associated with the id this widget is bind to.
 
75
     * @method element
 
76
     * @example
 
77
        var mydialog = UI.dialog("dialogid").element();
 
78
     */
 
79
    element: function () {
 
80
        return document.getElementById(this.id);
37
81
    }
38
82
};