Skip to content

Commit

Permalink
Fix todos example, and imply launch screen everywhere
Browse files Browse the repository at this point in the history
  • Loading branch information
Sashko Stubailo committed Aug 7, 2015
1 parent 90dec37 commit c568ce6
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 14 deletions.
9 changes: 8 additions & 1 deletion examples/todos/.meteor/packages
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,16 @@
# 'meteor add' and 'meteor remove' will edit this file for you,
# but you can also edit it by hand.

meteor-platform
meteor-base
blaze-html-templates
session
mongo
mobile-experience
standard-minifiers
insecure
less
iron:[email protected]
accounts-password
jquery
tracker
check
20 changes: 10 additions & 10 deletions examples/todos/client/templates/lists-show.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ Template.listsShow.helpers({

var editList = function(list, template) {
Session.set(EDITING_KEY, true);

// force the template to redraw based on the reactive change
Tracker.flush();
template.$('.js-edit-form input[type=text]').focus();
Expand All @@ -64,7 +64,7 @@ var deleteList = function(list) {
if (! list.userId && Lists.find({userId: {$exists: false}}).count() === 1) {
return alert("Sorry, you cannot delete the final public list!");
}

var message = "Are you sure you want to delete the list " + list.name + "?";
if (confirm(message)) {
// we must remove each item individually from the client
Expand Down Expand Up @@ -101,15 +101,15 @@ Template.listsShow.events({
'click .js-cancel': function() {
Session.set(EDITING_KEY, false);
},

'keydown input[type=text]': function(event) {
// ESC
if (27 === event.which) {
event.preventDefault();
$(event.target).blur();
}
},

'blur input[type=text]': function(event, template) {
// if we are still editing (we haven't just clicked the cancel button)
if (Session.get(EDITING_KEY))
Expand All @@ -120,7 +120,7 @@ Template.listsShow.events({
event.preventDefault();
saveList(this, template);
},

// handle mousedown otherwise the blur handler above will swallow the click
// on iOS, we still require the click event so handle both
'mousedown .js-cancel, click .js-cancel': function(event) {
Expand All @@ -139,19 +139,19 @@ Template.listsShow.events({

event.target.selectedIndex = 0;
},

'click .js-edit-list': function(event, template) {
editList(this, template);
},

'click .js-toggle-list-privacy': function(event, template) {
toggleListPrivacy(this, template);
},

'click .js-delete-list': function(event, template) {
deleteList(this, template);
},

'click .js-todo-add': function(event, template) {
template.$('.js-todo-new input').focus();
},
Expand All @@ -162,7 +162,7 @@ Template.listsShow.events({
var $input = $(event.target).find('[type=text]');
if (! $input.val())
return;

Todos.insert({
listId: this._id,
text: $input.val(),
Expand Down
10 changes: 7 additions & 3 deletions packages/mobile-experience/package.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,13 @@ Package.onUse(function(api) {
"fastclick",

// A nicer appearance for the status bar in PhoneGap/Cordova apps
"mobile-status-bar",
"mobile-status-bar"
], "web.cordova");

// Show a nice splash image while your PhoneGap/Cordova app's UI is loading
api.imply([
// Show a nice splash image while your PhoneGap/Cordova app's UI is loading.
// Doesn't do anything without Cordova, but we include it everywhere so you
// don't need a ton of if statements around your LaunchScreen calls.
"launch-screen"
], "web.cordova");
]);
});

0 comments on commit c568ce6

Please sign in to comment.