rajeshwarpatlolla / ionic-toast

'ionic-toast' bower component for ionic framework applications
MIT License
157 stars 60 forks source link

Possible to make it work with animate.css? #10

Open arashb31 opened 8 years ago

arashb31 commented 8 years ago

Any way of adding animations to the toast appearing/disappearing (like Android)?

Maybe add some classes for it to work with animate.css

anjumnawab commented 8 years ago

Hey @arashb31 you can archive this by doing some minor tweaks to ionic-toast.js line number 57

toastScope.hide = function () { toastScope.ionicToast.toastClass = 'ionic_toast_top ionic_toast_sticky animated fadeOutDown'; };

and line number 70

angular.extend(toastScope.ionicToast, { toastClass: toastPosition[position] + ' ' + (closeBtn ? 'ionic_toast_sticky animated fadeInDown' : ''), toastMessage: message });

You also need to have animate.css file from https://daneden.github.io/animate.css/

Hope this help :)

arashb31 commented 8 years ago

Great that works!. How about adding an optional parameter on the toast.show to add any optional classes/IDs?

eg.

var classes = { 
 openID: "myID", 
 openClass: "animated fadeInLeft",
 closeClass : "animated fadeOutRight"
}

  ionicToast.show('This is a toast at the top.', 'top', true, 2500, classes);
Arxi commented 8 years ago

+1 for optional parameter for adding classes

great work, by the way!