Skip to content

Instantly share code, notes, and snippets.

View willmorgan's full-sized avatar

Will Morgan willmorgan

View GitHub Profile
@willmorgan
willmorgan / transitionmasher.js
Created November 6, 2013 13:38
transitionmasher.js
if(this.transitions) {
body.addClass('bhv-transition-now').css('height', fullHeight);
body.height();
body.removeClass('bhv-transition-now').addClass('state-transitioning');
body.height();
body.css('height', 0);
body.on('transitionend.close', function(event) {
body.off('transitionend.close');
body.addClass('state-hidden');
body.height();
@willmorgan
willmorgan / TableOptionsetField.php
Last active December 18, 2015 11:19
3,1 DataObjectManager style field that allows arbitrary options to be rendered on the frontend with maximum flexibility and ease.
<?php
/**
* TableOptionsetField
* DataObjectManager style field that allows arbitrary options to be rendered on
* the frontend with maximum flexibility and ease.
* @author Will Morgan <will@betterbrief.co.uk>
*/
class TableOptionsetField extends FormField {
@willmorgan
willmorgan / JavaScriptConfig.php
Created October 18, 2012 12:03
JavaScriptConfig: A utility class to add in configuration information for JS files in the head tag.
<?php
/**
* JavaScriptConfig
* A utility class to add in configuration information for JS files in the head
* section, directly from PHP and json_encode with Requirements.
* Used with SilverStripe 2.4+
* @author @willmorgan
*/
class JavaScriptConfig {