Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Some bugfixes #54

Merged
merged 4 commits into from

2 participants

@lingo

Hi there, a few minor changes here. The only thing that may be problematic is there's a large 'cleanup' commit that standardises the whitespace and adds missing semicolons. This may break merging, so let me know if that's the case and I'll rebase and reissue the pull request.

Cheers!

lingo added some commits
@lingo lingo BUGFIX: Ambiguous ID in MultipleFileAttachment a19d59c
@lingo lingo Cleanup indenting and add missing semicolons etc 0ec2aba
@lingo lingo BUGFIX: Uploading now preserves previously uploaded files cdc6b1b
@lingo lingo BUGFIX: Fix scrolling bug in KickAssets window.
This bug could be reproduced by opening the kickassets admin window and
making a rectangular selection which extended outside the window.  This
would cause scrollbars to appear on the kickassets window, which would
obscure the file list scrollbar.  Also the button bar at bottom would
disappear out of view.
26c99b3
@lingo

This is a whitespace-only change, except for a few missing semicolons which have been added in where they were required.

@unclecheese unclecheese merged commit 776c737 into unclecheese:master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Nov 12, 2012
  1. @lingo
Commits on Nov 14, 2012
  1. @lingo
  2. @lingo
  3. @lingo

    BUGFIX: Fix scrolling bug in KickAssets window.

    lingo authored
    This bug could be reproduced by opening the kickassets admin window and
    making a rectangular selection which extended outside the window.  This
    would cause scrollbars to appear on the kickassets window, which would
    obscure the file list scrollbar.  Also the button bar at bottom would
    disappear out of view.
This page is out of date. Refresh to see the latest.
View
2  code/MultipleFileAttachmentField.php
@@ -70,7 +70,7 @@ public function refresh(SS_HTTPRequest $r) {
$files = new DataObjectSet();
$implodestring = implode(',',$ids);
$implodestring = preg_replace("/^[,]/", "", $implodestring);
- if($set = DataObject::get("File", "`ID` IN ($implodestring)")) {
+ if($set = DataObject::get("File", "`File`.`ID` IN ($implodestring)")) {
foreach($set as $file) {
$this->processFile($file);
$files->push($file);
View
3  css/kickassets.css
@@ -1,3 +1,6 @@
+body#KickAssets {
+ overflow: hidden;
+}
#directory_list {padding:10px;}
#directory_list li {list-style:none;}
View
144 javascript/file_attachment_field.js
@@ -2,13 +2,26 @@ var $parentField;
(function($) {
$(function() {
+
+ function fetchIDs($parentField) {
+ var ids = [];
+ var $wrap = $parentField.closest('.FileAttachmentField');
+ // make sure we don't lose any unsaved files.
+ if($wrap.is('.multi')) {
+ $wrap.find('.file_block').each(function() {
+ ids.push( $(this).find(':hidden').val() );
+ });
+ }
+ return ids;
+ }
+
$('.file_attach_btn').livequery(function() {
$(this).fancybox({
'width' : '90%',
'height' : '98%',
- 'autoScale' : false,
+ 'autoScale' : false,
'padding' : 0,
- 'transitionIn' : 'none',
+ 'transitionIn' : 'none',
'transitionOut' : 'none',
'titleShow' : false,
'type' : 'iframe',
@@ -18,22 +31,18 @@ $(function() {
'onCleanup' : function() {
var ids = $('#fancybox-frame').contents().find('#selected_files').text();
if(!ids.length) return;
+ ids = ids.split(',');
+ ids = ids.concat(fetchIDs($parentField));
var $wrap = $parentField.closest('.FileAttachmentField');
- // make sure we don't lose any unsaved files.
- if($wrap.is('.multi')) {
- $wrap.find('.file_block').each(function() {
- ids += ',';
- ids += $(this).find(':hidden').val();
- })
- }
+
$wrap.find('.attached_files').load(
$parentField.attr('data-refreshlink'),
- { 'ids' : ids.split(',') }
+ { 'ids' : ids }
);
- $parentField = null;
+ $parentField = null;
}
- })
+ });
});
$('.detach_btn').live("click",function() {
@@ -47,7 +56,7 @@ $(function() {
$div.find('.file_drop').addClass('empty').css('background-image','none');
$div.find('.file_name').empty();
$(this).remove();
- $div.find('input[value='+id+']').val(0);
+ $div.find('input[value='+id+']').val(0);
}
showNoFile(false);
return false;
@@ -55,8 +64,8 @@ $(function() {
$('.file_attach_upload').live("change", function(e) {
doUpload($(this), e.target.files, $(this).attr('data-uploadurl'));
- e.preventDefault();
- e.stopPropagation();
+ e.preventDefault();
+ e.stopPropagation();
}).live("mouseenter", function() {
$(this).siblings('.file_upload_btn').addClass('over');
}).live("mouseleave", function() {
@@ -70,7 +79,7 @@ $(function() {
$('.file_cancel_btn').show();
}
$('.controls_no_file').fadeIn();
- })
+ });
};
@@ -78,10 +87,10 @@ $(function() {
$('.controls_no_file').fadeOut(function() {
$('.file_cancel_btn').hide();
$('.controls_has_file').fadeIn();
- })
- }
+ });
+ };
- $('.replace_btn').live("click", function() {showNoFile(true)});
+ $('.replace_btn').live("click", function() {showNoFile(true);});
$('.file_cancel_btn').live("click", showHasFile);
@@ -91,23 +100,23 @@ $(function() {
var $t = $(this);
$.get($t.attr('href'), function() {
$t.siblings('.detach_btn').click();
- })
+ });
}
return false;
});
var doUpload = function($t, files, url) {
- var http = new XMLHttpRequest();
- if($t.closest('.FileAttachmentField').is('.single') && files.length > 1) {
+ var http = new XMLHttpRequest();
+ if($t.closest('.FileAttachmentField').is('.single') && files.length > 1) {
return false;
- }
+ }
var $progressBar = $t.closest('.FileAttachmentField').find('.progress');
var uploadTimeout = window.setTimeout(function() {
$progressBar.parent().css('visibility', 'visible');
// Update progress bar
- http.upload.addEventListener("progress", function (evt) {
+ http.upload.addEventListener("progress", function (evt) {
if (evt.lengthComputable) {
$progressBar.css('width', (evt.loaded / evt.total) * 100 + "%");
}
@@ -115,7 +124,7 @@ $(function() {
}
}, false);
},1000);
- var url = $t.attr('data-uploadurl');
+ url = $t.attr('data-uploadurl');
http.addEventListener("load", function () {
window.clearTimeout(uploadTimeout);
@@ -124,61 +133,64 @@ $(function() {
alert(http.responseText);
}
else {
- var $div = $t.closest('.FileAttachmentField')
+ var ids = http.responseText.split(',');
+ ids = ids.concat(fetchIDs($t));
+
+ var $div = $t.closest('.FileAttachmentField');
$div.find('.attached_files').load(
$div.attr('data-refreshlink'),
- { 'ids' : http.responseText.split(',')}
+ { 'ids' : ids }
);
}
}, false);
- if (typeof(FormData) != 'undefined') {
- var form = new FormData();
+ if (typeof(FormData) != 'undefined') {
+ var form = new FormData();
- for (var i = 0; i < files.length; i++) {
- form.append('file[]', files[i]);
- }
+ for (var i = 0; i < files.length; i++) {
+ form.append('file[]', files[i]);
+ }
- http.open('POST', url);
- http.send(form);
- }
+ http.open('POST', url);
+ http.send(form);
+ }
else {
- alert('Your browser does not support standard HTML5 Drag and Drop');
- }
+ alert('Your browser does not support standard HTML5 Drag and Drop');
+ }
- }
+ };
- var dnd = {
- ready : function() {
- $('.file_drop').live('dragenter', function(e) {
- e.preventDefault();
- e.stopPropagation();
- $(this).addClass('over');
- }).live('dragover', function(e) {
- e.preventDefault();
- e.stopPropagation();
- }).live('drop', function(e) {
- if(e.handled == true) return;
- e.handled = true;
- if(e.originalEvent.dataTransfer) {
- if (e.originalEvent.dataTransfer.files.length) {
-
- var files = e.originalEvent.dataTransfer.files;
- var $t = $(this);
- doUpload($t, files, $t.attr('data-uploadurl'));
- e.preventDefault();
- e.stopPropagation();
- $(this).removeClass('over');
-
- }
- }
- }).live('dragleave', function(e) {
+ var dnd = {
+ ready : function() {
+ $('.file_drop').live('dragenter', function(e) {
+ e.preventDefault();
+ e.stopPropagation();
+ $(this).addClass('over');
+ }).live('dragover', function(e) {
+ e.preventDefault();
+ e.stopPropagation();
+ }).live('drop', function(e) {
+ if(e.handled == true) return;
+ e.handled = true;
+ if(e.originalEvent.dataTransfer) {
+ if (e.originalEvent.dataTransfer.files.length) {
+
+ var files = e.originalEvent.dataTransfer.files;
+ var $t = $(this);
+ doUpload($t, files, $t.attr('data-uploadurl'));
+ e.preventDefault();
+ e.stopPropagation();
+ $(this).removeClass('over');
+
+ }
+ }
+ }).live('dragleave', function(e) {
e.preventDefault();
e.stopPropagation();
$(this).removeClass('over');
- });
- }
+ });
+ }
@@ -186,5 +198,5 @@ $(function() {
$('.file_drop').livequery(dnd.ready);
-})
+});
})(jQuery);
View
400 javascript/kickassets.js
@@ -2,138 +2,138 @@
var refreshFiles = function() {
$('#drop').load(window.location.href);
};
-
-
- var dnd = {
- ready : function()
- {
- $('#drop, #replace-file')
- .live(
- 'dragenter',
- function(e) {
- e.preventDefault();
- e.stopPropagation();
- $(this).addClass('over');
- }
- )
- .live(
+
+
+ var dnd = {
+ ready : function()
+ {
+ $('#drop, #replace-file')
+ .live(
+ 'dragenter',
+ function(e) {
+ e.preventDefault();
+ e.stopPropagation();
+ $(this).addClass('over');
+ }
+ )
+ .live(
'dragover',
function(e) {
e.preventDefault();
e.stopPropagation();
}
-
- )
- .live(
- 'drop',
- function(e) {
- if(e.originalEvent.dataTransfer) {
- if (e.originalEvent.dataTransfer.files.length) {
- dnd.upload(e.originalEvent.dataTransfer.files, $(this).data('uploadurl'));
- e.preventDefault();
- e.stopPropagation();
+
+ )
+ .live(
+ 'drop',
+ function(e) {
+ if(e.originalEvent.dataTransfer) {
+ if (e.originalEvent.dataTransfer.files.length) {
+ dnd.upload(e.originalEvent.dataTransfer.files, $(this).data('uploadurl'));
+ e.preventDefault();
+ e.stopPropagation();
+ $(this).removeClass('over');
+ }
+ }
+ }
+ )
+ .live(
+ 'dragleave',
+ function(e) {
+ e.preventDefault();
+ e.stopPropagation();
$(this).removeClass('over');
- }
- }
- }
- )
- .live(
- 'dragleave',
- function(e) {
- e.preventDefault();
- e.stopPropagation();
- $(this).removeClass('over');
- }
- );
-
-
- },
-
- upload : function(files,url)
- {
- // This is a work-around for Safari occaisonally hanging when doing a
- // file upload. For some reason, an additional HTTP request for a blank
- // page prior to sending the form will force Safari to work correctly.
-
-// $.get('file/blank.html');
-
- var http = new XMLHttpRequest();
- // var progressBar = document.getElementById('progress');
- //
- // // Update progress bar
- // http.upload.addEventListener("progress", function (evt) {
- // if (evt.lengthComputable) {
- // progressBar.style.width = (evt.loaded / evt.total) * 100 + "%";
- // }
- // else {
- // }
- // }, false);
-
- http.addEventListener("load", function () {
- if(http.responseText != "OK") {
- apprise(http.responseText, {appendTo:'#drop'});
- }
- refreshFiles();
- if($('#drop').is('.open')) {
- var id = $('#Form_FileEditForm').find('[name=ID]').val();
- $('li[data-id='+id+'] img').dblclick();
+ }
+ );
+
+
+ },
+
+ upload : function(files,url)
+ {
+ // This is a work-around for Safari occaisonally hanging when doing a
+ // file upload. For some reason, an additional HTTP request for a blank
+ // page prior to sending the form will force Safari to work correctly.
+
+ // $.get('file/blank.html');
+
+ var http = new XMLHttpRequest();
+ // var progressBar = document.getElementById('progress');
+ //
+ // // Update progress bar
+ // http.upload.addEventListener("progress", function (evt) {
+ // if (evt.lengthComputable) {
+ // progressBar.style.width = (evt.loaded / evt.total) * 100 + "%";
+ // }
+ // else {
+ // }
+ // }, false);
+
+http.addEventListener("load", function () {
+ if(http.responseText != "OK") {
+ apprise(http.responseText, {appendTo:'#drop'});
+ }
+ refreshFiles();
+ if($('#drop').is('.open')) {
+ var id = $('#Form_FileEditForm').find('[name=ID]').val();
+ $('li[data-id='+id+'] img').dblclick();
+ }
+ }, false);
+
+
+ if (typeof(FormData) != 'undefined') {
+ var form = new FormData();
+
+
+ for (var i = 0; i < files.length; i++) {
+ form.append('file[]', files[i]);
+ }
+
+ http.open('POST', url);
+ http.send(form);
+ } else {
+ alert('Your browser does not support standard HTML5 Drag and Drop');
}
- }, false);
+ },
+ getFileSize : function(bytes)
+ {
+ switch (true) {
+ case (bytes < Math.pow(2,10)): {
+ return bytes + ' Bytes';
+ }
+ case (bytes >= Math.pow(2,10) && bytes < Math.pow(2,20)): {
+ return Math.round(bytes / Math.pow(2,10)) +' KB';
+ }
+ case (bytes >= Math.pow(2,20) && bytes < Math.pow(2,30)): {
+ return Math.round((bytes / Math.pow(2,20)) * 10) / 10 + ' MB';
+ }
+ case (bytes > Math.pow(2,30)): {
+ return Math.round((bytes / Math.pow(2,30)) * 100) / 100 + ' GB';
+ }
+ }
+ }
+ };
- if (typeof(FormData) != 'undefined') {
- var form = new FormData();
-
-
- for (var i = 0; i < files.length; i++) {
- form.append('file[]', files[i]);
- }
-
- http.open('POST', url);
- http.send(form);
- } else {
- alert('Your browser does not support standard HTML5 Drag and Drop');
- }
- },
-
- getFileSize : function(bytes)
- {
- switch (true) {
- case (bytes < Math.pow(2,10)): {
- return bytes + ' Bytes';
- };
- case (bytes >= Math.pow(2,10) && bytes < Math.pow(2,20)): {
- return Math.round(bytes / Math.pow(2,10)) +' KB';
- };
- case (bytes >= Math.pow(2,20) && bytes < Math.pow(2,30)): {
- return Math.round((bytes / Math.pow(2,20)) * 10) / 10 + ' MB';
- };
- case (bytes > Math.pow(2,30)): {
- return Math.round((bytes / Math.pow(2,30)) * 100) / 100 + ' GB';
- };
- }
- }
- };
-
$(document).ready(dnd.ready);
$(document).ready(function() {
// $('#drop, #replace-file').livequery(dnd.ready);
// $('#drop').css('height',$('body').height()-20+'px');
var toRename;
-
+
$('#filesystemsync').click(function() {
$.get($(this).attr('href'), function(data) {
apprise(data, {appendTo:'#drop'});
});
return false;
});
-
+
$('#newfolder').click(function() {
var $t = $(this);
$('#drop').load($t.attr('href'));
return false;
});
-
+
$('.editable').live("dblclick", function(e) {
if(e.target.tagName == "INPUT") {e.target.select();return}
var $t = $(this);
@@ -146,7 +146,7 @@ $(document).ready(function() {
});
-
+
$('.editable input').live("blur", function(e) {
if(!e.currentTarget.tagName == "INPUT") return;
var newName = $(this).val();
@@ -155,8 +155,8 @@ $(document).ready(function() {
$li.removeClass('ui-selected');
$li.load(
$('base').attr('href')+"admin/files/updatefilename",
- {
- 'new' : newName,
+ {
+ 'new' : newName,
'fileid' : $li.data('id')
}
);
@@ -165,15 +165,15 @@ $(document).ready(function() {
$(this).focusout();
}
});
-
-
+
+
$('#drop').livequery(function() {$(this).selectable({
cancel : '.editable,input',
filter : 'li',
selected : function() {
if($('.ui-selected').length > 1) {
- $('a.togglestate.single').addClass('disabled');
+ $('a.togglestate.single').addClass('disabled');
$('a.togglestate:not(.single)').removeClass('disabled');
}
else {
@@ -185,32 +185,32 @@ $(document).ready(function() {
$('a.togglestate').addClass('disabled');
}
});});
-
+
$('#directory_list li').livequery(function() {$(this).draggable({
- delay: 500,
- distance: 30,
- helper: function(){
- var selected = $('#directory_list .ui-selected');
- if (selected.length === 0) {
- selected = $(this);
- }
- var container = $('<div/>').attr('id', 'draggingContainer');
- container.append(selected.clone());
- return container;
- }
+ delay: 500,
+ distance: 30,
+ helper: function(){
+ var selected = $('#directory_list .ui-selected');
+ if (selected.length === 0) {
+ selected = $(this);
+ }
+ var container = $('<div/>').attr('id', 'draggingContainer');
+ container.append(selected.clone());
+ return container;
+ }
});});
-
+
$('#directory_list.gallery li img, #directory_list.grid li').live("click", function(event) {
if(!event.metaKey) {
$('.ui-selected').removeClass('ui-selected');
- $(this).closest('li').addClass('ui-selected');
+ $(this).closest('li').addClass('ui-selected');
}
else {
$(this).closest('li').toggleClass('ui-selected');
}
if($('.ui-selected').length) {
if($('.ui-selected').length > 1) {
- $('a.togglestate.single').addClass('disabled');
+ $('a.togglestate.single').addClass('disabled');
$('a.togglestate:not(.single)').removeClass('disabled');
}
else {
@@ -222,7 +222,7 @@ $(document).ready(function() {
}
event.stopPropagation();
});
-
+
// #('#drop').live("click",function(event) {
// $('.ui-selected').removeClass('ui-selected');
// })
@@ -233,7 +233,7 @@ $(document).ready(function() {
$(this).css('background','#ddd');
},
out: function() {
- $(this).css('background','transparent');
+ $(this).css('background','transparent');
},
drop: function(event, ui) {
var $li = $(this);
@@ -248,23 +248,23 @@ $(document).ready(function() {
'source': files,
'dest': $li.data('id')
}
- )
+ );
},
tolerance: 'pointer'
});});
-
-
+
+
$('li:not(.head)').each(function(i,e) {
if(i % 2 == 1) {
$(e).addClass('even');
}
});
-
-
+
+
var timeout;
$('#search input').keyup(function() {
if(timeout) window.clearTimeout(timeout);
- s = $(this).val();
+ s = $(this).val();
timeout = window.setTimeout(function() {
$('#directory_list li:not(.head)').hide();
$('#directory_list li:not(.head)').each(function() {
@@ -272,11 +272,11 @@ $(document).ready(function() {
if($(this).find('.filename').text().match(reg)) {
$(this).show();
}
- });
- },150);
+ });
+ },150);
});
-
-
+
+
$('img[data-tooltipurl]').livequery(function() {
var $t = $(this);
var tooltipType = $t.data('tooltipurl');
@@ -294,15 +294,15 @@ $(document).ready(function() {
});
});
-
+
var openEditWindow = function (callback) {
if(!$('#drop').hasClass('open')) {
doResize();
$('#drop').animate({'width': $(window).width()-360+'px'});
$('#edit').animate({'width':'350px'},function() {
- $('select[name=ParentID]').find('option').each(function() {
+ $('select[name=ParentID]').find('option').each(function() {
$(this).html($(this).html().replace(/__/g,'&nbsp;&nbsp;'));
- })
+ });
$('select[name=ParentID]').chosen();
if(callback && typeof(callback) == "function") {
callback();
@@ -312,20 +312,20 @@ $(document).ready(function() {
}
};
-
+
var closeEditWindow = function (callback) {
if($('#drop').hasClass('open')) {
$('#drop').animate({'width':$(window).width()-10+'px'});
$('#edit').animate({'width':'0'}, function() {
if(callback && typeof(callback) == "function") {
callback();
- }
+ }
});
$('#drop').removeClass('open');
}
- }
-
+ };
+
var doResize = function () {
$('#drop, #edit').css('height', ($(window).height()-98)+'px');
if($('#drop').hasClass('open')) {
@@ -341,14 +341,14 @@ $(document).ready(function() {
$('body').removeClass('small');
}
};
-
-
+
+
var doUpload = function(files, url) {
- var http = new XMLHttpRequest();
+ var http = new XMLHttpRequest();
var $progressBar = $('#progress');
var uploadTimeout = window.setTimeout(function() {
// Update progress bar
- http.upload.addEventListener("progress", function (evt) {
+ http.upload.addEventListener("progress", function (evt) {
if (evt.lengthComputable) {
$progressBar.css('width', (evt.loaded / evt.total) * 100 + "%");
}
@@ -368,23 +368,23 @@ $(document).ready(function() {
}, false);
- if (typeof(FormData) != 'undefined') {
- var form = new FormData();
+ if (typeof(FormData) != 'undefined') {
+ var form = new FormData();
- for (var i = 0; i < files.length; i++) {
- form.append('file[]', files[i]);
- }
+ for (var i = 0; i < files.length; i++) {
+ form.append('file[]', files[i]);
+ }
- http.open('POST', url);
- http.send(form);
- }
+ http.open('POST', url);
+ http.send(form);
+ }
else {
- alert('Your browser does not support standard HTML5 Drag and Drop');
- }
+ alert('Your browser does not support standard HTML5 Drag and Drop');
+ }
+
+ };
+
- }
-
-
$('.file img, .grid .file').live("dblclick", function(e) {
if($(e.target).is('.editable')) return;
var $t = $(this).closest('li');
@@ -394,17 +394,17 @@ $(document).ready(function() {
);
});
-
+
$('.folder img, .grid .folder').live('dblclick', function(e) {
if($(e.target).is('.editable')) return;
var $t = $(this).closest('li');
window.location.href = $t.data('link');
return false;
});
-
+
$('#delete').live("click", function() {
if($(this).is('.disabled')) return false;
-
+
var $t = $(this);
var files = [];
$('.ui-selected:visible').each(function() {
@@ -412,92 +412,92 @@ $(document).ready(function() {
});
apprise($t.data('confirmtext'),{'confirm':true,appendTo:'#drop'},function(r) {
if(r) {
- $('#drop').load($t.attr('href'), {list : files});
+ $('#drop').load($t.attr('href'), {list : files});
}
});
return false;
});
-
+
$('#edit_button').click(function() {
if(!$(this).is('.disabled')) {
if($('#directory_list').is('.grid')) {
- $('.ui-selected:first').dblclick();
+ $('.ui-selected:first').dblclick();
}
else {
$('.ui-selected:first img').dblclick();
}
-
+
}
return false;
});
-
-
-
+
+
+
$('#Form_FileEditForm_action_doFileCancel').live("click", function() {
closeEditWindow();
return false;
});
-
+
$('#Form_FileEditForm').livequery(function() {
$(this).ajaxForm(function(response) {
closeEditWindow(function() {
refreshFiles();
});
});
-
+
});
-
+
$('.file_attach_upload').live("change", function(e) {
doUpload(e.target.files, $('#drop').data('uploadurl'));
- e.preventDefault();
- e.stopPropagation();
+ e.preventDefault();
+ e.stopPropagation();
}).live("mouseenter", function() {
$(this).siblings('.file_upload_btn').addClass('over');
}).live("mouseleave", function() {
$(this).siblings('.file_upload_btn').removeClass('over');
});
-
-
- $(window).resize(doResize);
- $('#drop').css('width', $(window).width()-10+'px');
+
+
+ $(window).resize(doResize);
+ $('#drop').css('width', $(window).width()-10+'px');
doResize();
$('#footer').css('visibility','visible');
var vars = [], hash;
- var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&');
- for(var i = 0; i < hashes.length; i++) {
- hash = hashes[i].split('=');
- vars.push(hash[0]);
- vars[hash[0]] = hash[1];
- }
+ var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&');
+ for(var i = 0; i < hashes.length; i++) {
+ hash = hashes[i].split('=');
+ vars.push(hash[0]);
+ vars[hash[0]] = hash[1];
+ }
if(vars["edit"]) {
$('li[data-id='+vars["edit"]+'] img').dblclick();
}
-
+
var ajaxTimeout;
-
+
$('body').ajaxStart(function() {
ajaxTimeout = window.setTimeout(function() {
window.parent.jQuery.fancybox.showActivity();
- },1500)
+ },1500);
}).ajaxStop(function() {
window.clearTimeout(ajaxTimeout);
window.parent.jQuery.fancybox.hideActivity();
});
-
+
// FileAttachmentField
function getParent() {
return window.parent.$parentField;
}
-
+
if(getParent() && !getParent().is('.multi')) {
$('#attach').addClass('single');
}
-
+
$('#attach').click(function() {
if(!$(this).is('.disabled')) {
var ids = [];
@@ -505,11 +505,11 @@ $(document).ready(function() {
ids.push($(this).data('id'));
});
$('#selected_files').append(ids.join(','));
- window.parent.jQuery.fancybox.close();
+ window.parent.jQuery.fancybox.close();
}
});
-
-
+
+
$('#view a').click(function() {
var $t = $(this);
$.post(
@@ -520,11 +520,11 @@ $(document).ready(function() {
$('#directory_list').attr('class', response);
}
);
- return false;
+ return false;
});
});
-
+
})(jQuery);
View
2  templates/KickAssetAdmin.ss
@@ -5,7 +5,7 @@
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title><% _t('AssetAdmin.MENUTITLE','Files & Images') %></title>
</head>
- <body>
+ <body id="KickAssets">
<div id="head">
<h2>$BreadCrumbs</h2>
Something went wrong with that request. Please try again.