Last active
December 21, 2017 04:26
-
-
Save ocean/0f7092d3013e5daecb101554817cf5a4 to your computer and use it in GitHub Desktop.
Add another title box for a Mines link
This file contains 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
// Add Mines title block | |
(function($) { | |
Drupal.addMinesTitle = function() { | |
var containerDiv = document.getElementsByClassName('row divisions'); | |
var contents = document.createElement('div'); | |
$(contents).addClass('division'); | |
var link = document.createElement('a'); | |
$(link).addClass('division__link'); | |
$(link).attr('href', 'http://www.dmp.wa.gov.au/'); | |
var heading = document.createElement('h3'); | |
$(heading).addClass('division__title'); | |
$(heading).text('Mines and Petroleum'); | |
var desc = document.createElement('p'); | |
$(desc).addClass('division__description'); | |
$(desc).text('Regulates the resource sector in Western Australia, collects royalties and provides geoscientific information.'); | |
$(link).append(heading, desc); | |
$(contents).append(link); | |
$(containerDiv).children('div').last().before(contents); | |
}; | |
})(jQuery); | |
Drupal.addMinesTitle(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
... then link to this
https://cdn.rawgit.com/ocean/0f7092d3013e5daecb101554817cf5a4/raw/166ee6f11349cc5481807f52ada14fe54298b9b9/addMinesTitle.js
Thanks to RawGit!