summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMathew Winstone2013-03-15 18:17:46 (GMT)
committerMathew Winstone2013-03-15 18:17:46 (GMT)
commit16c1a795d9fb550a3026197bae5f59b72d7469d0 (patch)
treee41f4b63b58fc0085f12fb3e12b657f0b016b21b
parentd1b4413a5998998030c1f215df1a0a5a3ac1b74c (diff)
Added detection on forms for persist attribute
-rw-r--r--garlic.module9
1 files changed, 9 insertions, 0 deletions
diff --git a/garlic.module b/garlic.module
index 999c82d..2684254 100644
--- a/garlic.module
+++ b/garlic.module
@@ -64,6 +64,15 @@ function garlic_library() {
}
/**
+ * Implements hook_form_alter().
+ */
+function garlic_form_alter(&$form, &$form_state, $form_id) {
+ if (isset($form['#attributes']['data-persist']) && 'garlic' == $form['#attributes']['data-persist']) {
+ $form['#attached']['library'][] = array('garlic', 'garlic');
+ }
+}
+
+/**
* Implements hook_uninstall().
*/
function garlic_uninstall() {