Skip to content
This repository has been archived by the owner on Apr 24, 2019. It is now read-only.

Implement dialogs #48

Merged
merged 4 commits into from
Jul 21, 2013
Merged

Implement dialogs #48

merged 4 commits into from
Jul 21, 2013

Conversation

jaunesarmiento
Copy link
Owner

Implemented dialogs. This pull request exposes a Dialog class in the fries namespace with the ff methods:

  • init() - called when you do new fries.Dialog(options);. Initialises the dialog along with the options object. The dialog is initially hidden. Just call show() when you need to display the dialog.
  • show() - Shows the dialog.
  • hide() - Hides the dialog.

An example of the options object is as follows:

{
  selector: '#dialog',
  okCallback: function () {
    // this is called when the user presses the "OK" button inside the dialog
    // do something here
    // optionally, you can hide the dialog afterwards
    this.hide(); // "this" refers to the dialog
  },
  cancelCallback: function () {
    // this is called when the user presses the "Cancel" button inside the dialog
    // do something else here
    // usually, you just hide the dialog so:
    this.hide();
  }
}

Notes:

  • Currently, the dialog only works with the first DOM element specified in the selector parameter. So if you need to create multiple dialogs, you need to call new fries.Dialog() on each of those elements for now.
  • The okCallback and cancelCallback are optional parameters. Although it would seem pointless not to add an okCallback.

@jaunesarmiento
Copy link
Owner Author

TODO: add an example of the dialog on index.html

@aboudard
Copy link

aboudard commented Jul 2, 2013

Will test that !

Oh I have a question,
Since you use scss, why do you implement transitions and other css3 features "by hand" ?
Don't you want to use compass mixins ?
Just a question, I'm no expert on that really.

@jaunesarmiento
Copy link
Owner Author

I still haven't decided on which to use LOL. Now that you've mentioned it, I'll see which available mixins are viable. :)

@aboudard
Copy link

aboudard commented Jul 2, 2013

That's a good point :)

@jaunesarmiento jaunesarmiento mentioned this pull request Jul 9, 2013
jaunesarmiento added a commit that referenced this pull request Jul 21, 2013
@jaunesarmiento jaunesarmiento merged commit b73b878 into wip-1.0.1 Jul 21, 2013
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants