lib/generators/tmatt_cms/templates/js/utils/magnificPopup.js in tmatt_cms-0.1.7 vs lib/generators/tmatt_cms/templates/js/utils/magnificPopup.js in tmatt_cms-0.1.8
- old
+ new
@@ -1,16 +1,24 @@
/**
* Created by Charlie on 20/12/2016.
*/
-$(function() {
- $('.open-popup-link').magnificPopup({
- removalDelay: 500,
- type:'inline',
- midClick: true,
- callbacks: {
- beforeOpen: function() {
- this.st.mainClass = this.st.el.attr('data-effect');
- }
- }
- });
+$(document).on('turbolinks:load', function() {
+ $('.open-popup-link').magnificPopup({
+ removalDelay: 500,
+ type: 'inline',
+ midClick: true,
+ callbacks: {
+ beforeOpen: function () {
+ this.st.mainClass = this.st.el.attr('data-effect');
+ $('.navbar').hide().css({top: '-100px'});
+ },
+ close: function () {
+ $('.navbar').show();
+ setTimeout(function() {
+ $('.navbar').css({top: '0'});
+ }, 1);
+
+ }
+ }
+ });
});
\ No newline at end of file