From eb6338490055cb0f5f579d972218d037af6375d2 Mon Sep 17 00:00:00 2001 From: Ingo Schommer Date: Tue, 21 Feb 2012 21:17:49 +0100 Subject: [PATCH] MINOR Loading folders in AssetAdmin via panel ajax loading --- javascript/AssetAdmin.js | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/javascript/AssetAdmin.js b/javascript/AssetAdmin.js index 74127f5a..5212305a 100644 --- a/javascript/AssetAdmin.js +++ b/javascript/AssetAdmin.js @@ -23,6 +23,17 @@ }); $.entwine('ss', function($){ + + $('#Form_EditForm_File .ss-gridfield-item').entwine({ + onclick: function(e) { + var grid = this.closest('fieldset.ss-gridfield'); + if(this.data('class') == 'Folder') { + var url = grid.data('urlFolderTemplate').replace('%s', this.data('id')); + $('.cms-container').loadPanel(url); + e.preventDefault(); + } + } + }); /** * Class: #Form_SyncForm @@ -47,7 +58,7 @@ var currNode = $('.cms-tree')[0].firstSelected(); if(currNode) { var url = $(currNode).find('a').attr('href'); - $('.cms-content').loadForm(url); + $('.cms-content').loadForm(url); } $('.cms-tree')[0].setCustomURL('admin/assets/getsubtree'); $('.cms-tree')[0].reload({onSuccess: function() {