Materialize the switch from leanModal to modal with version 0.97.8
For those who want to use the latest version of Materialize, but donβt want to reorganize the code, just apply this to any page loading the modal.
(function($){ $.fn.leanModal = function(options) { if( $('.modal').length > 0 ){ $('.modal').modal(options); } }; $.fn.openModal = function(options) { $(this).modal(options); $(this).modal('open'); }; $.fn.closeModal = function() { $(this).modal('close'); }; })(jQuery);
This will allow you to use leanModal (), openModal (), and closeModal () functions with the new modal API.
Ron ross
source share