Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IonPopup - add cssClass, IonPopup.show etc now returns a handle to close individual popups, scope bug with multiple popups fixed #351

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
.build*
.idea*
.DS_Store
2 changes: 1 addition & 1 deletion components/ionPopup/ionPopup.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<template name="ionPopup">
<div class="backdrop">
<div class="popup-container">
<div class="popup">
<div class="popup {{cssClass}}">
{{#if hasHead}}
<div class="popup-head">
{{#if title}}
Expand Down
17 changes: 12 additions & 5 deletions components/ionPopup/ionPopup.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ IonPopup = {
title: options.title,
subTitle: options.subTitle,
buttons: this.buttons,
template: innerTemplate
template: innerTemplate,
cssClass: options.cssClass || ''
};

this.view = Blaze.renderWithData(this.template, data, $('.ionic-body').get(0));
Expand All @@ -35,10 +36,16 @@ IonPopup = {
$backdrop.addClass('visible active');
var $popup = $backdrop.find('.popup-container');
$popup.addClass('popup-showing active');

return {
close: function(){
Blaze.remove( this.view )
}.bind( this )
}
},

alert: function (options) {
IonPopup.show({
return IonPopup.show({
title: options.title,
subTitle: options.subTitle,
template: options.template,
Expand All @@ -57,7 +64,7 @@ IonPopup = {
},

confirm: function (options) {
IonPopup.show({
return IonPopup.show({
title: options.title,
subTitle: options.subTitle,
template: options.template,
Expand Down Expand Up @@ -97,7 +104,7 @@ IonPopup = {
template += '<input type="' + options.inputType + '" placeholder="' +
options.inputPlaceholder + '" name="prompt" >';

IonPopup.show({
return IonPopup.show({
title: options.title,
subTitle: options.subTitle,
template: template,
Expand Down Expand Up @@ -166,7 +173,7 @@ Template.ionPopup.events({

'click [data-index]': function (event, template) {
var index = $(event.target).data('index');
IonPopup.buttonClicked(index, event, template);
IonPopup.buttonClicked.call( template.data, index, event, template);
}

});
Expand Down