Last active
October 14, 2016 21:17
-
-
Save DuaelFr/074a7611294dc2174da6af4aa22b8cc2 to your computer and use it in GitHub Desktop.
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
| // Declaration globale. | |
| window.MonHelper = { | |
| function1: function (context, settings) { alert("truc de base"); } | |
| }; | |
| (function ($, Drupal) { | |
| "use strict"; | |
| Drupal.behaviors.TrucDuCore = { | |
| attach: function (context, settings) { | |
| MonHelper.function1(context, settings); | |
| } | |
| }; | |
| })(jQuery, Drupal); |
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 ($, Drupal) { | |
| // Surcharge de la fonction uniquement. | |
| MonHelper.function1 = function (context, settings) { alert("truc surchargé"); }; | |
| // -OU- surcharge de behavior. | |
| Drupal.behaviors.TrucDuCore = { | |
| attach: function (context, settings) { | |
| autre_truc(); | |
| } | |
| }; | |
| })(jQuery, Drupal); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment