Permalink
Browse files

FEATURE Trigger event when new or edit link is clicked

  • Loading branch information...
1 parent 9efcb9b commit 7a755da1012a4fafa8bfb7c9b77c6b1cd0aa242f @andrewandante andrewandante committed Feb 23, 2012
Showing with 17 additions and 3 deletions.
  1. +15 −1 javascript/GridField.js
  2. +1 −1 templates/Includes/GridFieldAction_Edit.ss
  3. +1 −1 templates/Includes/GridFieldTitle.ss
View
@@ -69,6 +69,20 @@ jQuery(function($){
).css({'position':'relative','margin':'0 auto','width':'65%'}).appendTo(eleInput.closest('th'));
}
}
- });
+ });
+
+ $('fieldset.ss-gridfield .new-link').entwine({
+ onclick: function(e) {
+ $(this).trigger('opennewview', $(this).prop('href'));
+ return false;
+ }
+ });
+
+ $('fieldset.ss-gridfield .edit-link').entwine({
+ onclick: function(e) {
+ $(this).trigger('openeditview', $(this).prop('href'));
+ return false;
+ }
+ });
});
@@ -1 +1 @@
-<a class="action-edit" href="$Link">edit</a>
+<a class="edit-link" href="$Link">edit</a>
@@ -1,3 +1,3 @@
<tr class="title">
- <th colspan="$ColumnCount"><h2>$Title</h2> <a href="$NewLink" class="action ss-ui-action-constructive ss-ui-button ui-button ui-widget ui-state-default ui-corner-all new">Add new</a></th>
+ <th colspan="$ColumnCount"><h2>$Title</h2> <a href="$NewLink" class="action ss-ui-action-constructive ss-ui-button ui-button ui-widget ui-state-default ui-corner-all new new-link">Add new</a></th>
</tr>

0 comments on commit 7a755da

Please sign in to comment.