Last active
August 29, 2015 14:05
-
-
Save graceman9/971566439b25f702223e to your computer and use it in GitHub Desktop.
Onpay (my custom module) with jquery.ui.dialog integration for node view page
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function($) { | |
$(function(){ | |
// jquery.ui.dialog init | |
$('.onpay-form').dialog({ | |
autoOpen: false, | |
show: { | |
effect: 'slideDown', | |
duration: 100 | |
}, | |
hide: { | |
effect: 'slideUp', | |
duration: 100 | |
} | |
}); | |
// jquery.ui.dialog on click | |
$('.onpay-contribute').click(function(){ | |
$('.onpay-form').dialog('open'); | |
return false; | |
}); | |
}); | |
})(jQuery); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// add dialog library | |
drupal_add_library('system', 'ui.dialog'); | |
// use dialog | |
drupal_add_js(path_to_theme() .'/js/node--gift.js'); | |
?> | |
<?php | |
/* somewhere in node template */ | |
global $user; | |
print l('Поддержать<span></span>', 'onpay-contribute', array( | |
'html' => TRUE, | |
'attributes' => array( | |
'class' => array( | |
'onpay-contribute', | |
), | |
'data-nid' => $node->nid, | |
'data-uid' => $user->uid, | |
), | |
)); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment