Skip to content

Commit cd2cb3b

Browse files
committed
add iframe resizer
1 parent 2552767 commit cd2cb3b

3 files changed

Lines changed: 30 additions & 31 deletions

File tree

public/class-hello-asso-public.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,8 @@ public function enqueue_scripts()
9898
* class.
9999
*/
100100

101-
wp_enqueue_script($this->plugin_name, esc_html(plugin_dir_url(__FILE__)) . 'js/hello-asso-public.js', array('jquery'), $this->version, false);
101+
wp_enqueue_script('iframe-resizer', plugin_dir_url(__FILE__) . 'js/iframe-resizer.jquery.js', array('jquery'), $this->version, false);
102+
wp_enqueue_script($this->plugin_name, plugin_dir_url(__FILE__) . 'js/hello-asso-public.js', array('jquery'), $this->version, false);
102103
}
103104

104105
public function loadShortcode()

public/js/hello-asso-public.js

Lines changed: 8 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,10 @@
1-
(function( $ ) {
2-
'use strict';
1+
'use strict';
32

4-
/**
5-
* All of the code for your public-facing JavaScript source
6-
* should reside in this file.
7-
*
8-
* Note: It has been assumed you will write jQuery code here, so the
9-
* $ function reference has been prepared for usage within the scope
10-
* of this function.
11-
*
12-
* This enables you to define handlers, for when the DOM is ready:
13-
*
14-
* $(function() {
15-
*
16-
* });
17-
*
18-
* When the window is loaded:
19-
*
20-
* $( window ).load(function() {
21-
*
22-
* });
23-
*
24-
* ...and/or other possibilities.
25-
*
26-
* Ideally, it is not considered best practise to attach more than a
27-
* single DOM-ready or window-load handler for a particular page.
28-
* Although scripts in the WordPress core, Plugins and Themes may be
29-
* practising this, we should strive to set a better example in our own work.
30-
*/
3+
(function ($) {
4+
setTimeout(function () {
5+
$('#idIframe').iframeResize({
6+
license: 'GPLv3'
7+
});
8+
}, 500);
319

32-
})( jQuery );
10+
})(jQuery);

0 commit comments

Comments
 (0)