social media btns
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
(function ($) {
|
||||
'use strict';
|
||||
Drupal.behaviors.addtoany = {
|
||||
attach: function (context, settings) {
|
||||
|
||||
|
||||
// Initial page setup
|
||||
|
||||
var addtoany_icon = $('input[name="addtoany_universal_button"]').next('label').find('img:first');
|
||||
var initial_icon_size_int = parseInt($('input[name="addtoany_buttons_size"]').val());
|
||||
|
||||
// Set the A2A icon's size to match selected Icon Size
|
||||
addtoany_icon.height(initial_icon_size_int).width(initial_icon_size_int);
|
||||
|
||||
|
||||
// Bring attention to large A2A icon option
|
||||
// because the universal button will likely be changed to match the other icons
|
||||
// (Drupal #states can't handle this)
|
||||
$('input[name="addtoany_buttons_size"]').change(function () {
|
||||
|
||||
var icon_size = $(this).val();
|
||||
var icon_size_int = parseInt(icon_size);
|
||||
|
||||
// Set the A2A icon's size to match selected Icon Size
|
||||
addtoany_icon.height(icon_size_int).width(icon_size_int);
|
||||
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
};
|
||||
|
||||
}(jQuery));
|
||||
@@ -0,0 +1,14 @@
|
||||
/* global a2a*/
|
||||
(function (Drupal) {
|
||||
'use strict';
|
||||
|
||||
Drupal.behaviors.addToAny = {
|
||||
attach: function (context, settings) {
|
||||
// If not the full document (it's probably AJAX), and window.a2a exists
|
||||
if (context !== document && window.a2a) {
|
||||
a2a.init_all('page'); // Init all uninitiated AddToAny instances
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
})(Drupal);
|
||||
Reference in New Issue
Block a user