summaryrefslogtreecommitdiffstats
path: root/core/js
diff options
context:
space:
mode:
authorThomas Tanghus <thomas@tanghus.net>2012-05-04 01:33:47 +0200
committerThomas Tanghus <thomas@tanghus.net>2012-05-04 01:33:47 +0200
commit8d1754041ed4e6b82d8a08e63a7d002cdf3480c8 (patch)
tree1c5681a0c237cac1ff69adc7d27934d4e27927ce /core/js
parente61e40c23db8ed4056e9a41b32005d679ff40978 (diff)
downloadnextcloud-server-8d1754041ed4e6b82d8a08e63a7d002cdf3480c8.tar.gz
nextcloud-server-8d1754041ed4e6b82d8a08e63a7d002cdf3480c8.zip
VCategories: Check if any categories are selected before json call. Add Close button. Remove log calls.
Diffstat (limited to 'core/js')
-rw-r--r--core/js/oc-vcategories.js13
1 files changed, 8 insertions, 5 deletions
diff --git a/core/js/oc-vcategories.js b/core/js/oc-vcategories.js
index 4d8d010a36f..dfed8223b1b 100644
--- a/core/js/oc-vcategories.js
+++ b/core/js/oc-vcategories.js
@@ -1,6 +1,5 @@
OCCategories={
edit:function(){
- console.log('OCCategories.edit');
if(OCCategories.app == undefined) {
OC.dialogs.alert('OCCategories.app is not set!');
return;
@@ -18,6 +17,9 @@ OCCategories={
modal: true,
height: 350, minHeight:200, width: 250, minWidth: 200,
buttons: {
+ 'Close': function() {
+ $(this).dialog("close");
+ },
'Delete':function() {
OCCategories.doDelete();
},
@@ -61,9 +63,12 @@ OCCategories={
}
},
doDelete:function(){
- var categories = $('#categorylist').find('input[type="checkbox"]').serialize();
+ var categories = $('#categorylist').find('input:checkbox').serialize();
+ if(categories == '' || categories == undefined) {
+ OC.dialogs.alert(t('core', 'No categories selected for deletion.'), t('core', 'Error'));
+ return false;
+ }
categories += '&app=' + OCCategories.app;
- console.log('OCCategories.delete: ' + categories);
$.post(OC.filePath(OCCategories.app, 'ajax', 'categories/delete.php'), categories, OCCategories._processDeleteResult)
.error(function(xhr){
if (xhr.status == 404) {
@@ -72,7 +77,6 @@ OCCategories={
});
},
add:function(category){
- console.log('OCCategories.add ' + category);
$.getJSON(OC.filePath('core', 'ajax', 'vcategories/add.php'),{'category':category, 'app':OCCategories.app},function(jsondata){
if(jsondata.status == 'success'){
OCCategories._update(jsondata.data.categories);
@@ -83,7 +87,6 @@ OCCategories={
return false;
},
rescan:function(){
- console.log('Categories.rescan');
$.getJSON(OC.filePath(OCCategories.app, 'ajax', 'categories/rescan.php'),function(jsondata, status, xhr){
if(jsondata.status == 'success'){
OCCategories._update(jsondata.data.categories);