Skip to content
Snippets Groups Projects
Commit 2d9d59de authored by Thomas Müller's avatar Thomas Müller
Browse files

Merge pull request #20171 from owncloud/tags.js-remove-unneeded-vars

[tags] remove unneeded variables
parents 27db39bd b32e6fbb
No related branches found
No related tags found
No related merge requests found
...@@ -87,7 +87,6 @@ OC.Tags= { ...@@ -87,7 +87,6 @@ OC.Tags= {
} }
type = type ? type : this.type; type = type ? type : this.type;
var defer = $.Deferred(), var defer = $.Deferred(),
self = this,
url = OC.generateUrl('/tags/{type}/ids', {type: type}); url = OC.generateUrl('/tags/{type}/ids', {type: type});
$.getJSON(url, {tag: tag}, function(response) { $.getJSON(url, {tag: tag}, function(response) {
if(response.status === 'success') { if(response.status === 'success') {
...@@ -108,7 +107,6 @@ OC.Tags= { ...@@ -108,7 +107,6 @@ OC.Tags= {
} }
type = type ? type : this.type; type = type ? type : this.type;
var defer = $.Deferred(), var defer = $.Deferred(),
self = this,
url = OC.generateUrl('/tags/{type}/favorites', {type: type}); url = OC.generateUrl('/tags/{type}/favorites', {type: type});
$.getJSON(url, function(response) { $.getJSON(url, function(response) {
if(response.status === 'success') { if(response.status === 'success') {
...@@ -129,7 +127,6 @@ OC.Tags= { ...@@ -129,7 +127,6 @@ OC.Tags= {
} }
type = type ? type : this.type; type = type ? type : this.type;
var defer = $.Deferred(), var defer = $.Deferred(),
self = this,
url = OC.generateUrl('/tags/{type}', {type: type}); url = OC.generateUrl('/tags/{type}', {type: type});
$.getJSON(url, function(response) { $.getJSON(url, function(response) {
if(response.status === 'success') { if(response.status === 'success') {
...@@ -152,7 +149,6 @@ OC.Tags= { ...@@ -152,7 +149,6 @@ OC.Tags= {
} }
type = type ? type : this.type; type = type ? type : this.type;
var defer = $.Deferred(), var defer = $.Deferred(),
self = this,
url = OC.generateUrl('/tags/{type}/tag/{id}/', {type: type, id: id}); url = OC.generateUrl('/tags/{type}/tag/{id}/', {type: type, id: id});
$.post(url, {tag: tag}, function(response) { $.post(url, {tag: tag}, function(response) {
if(response.status === 'success') { if(response.status === 'success') {
...@@ -201,7 +197,6 @@ OC.Tags= { ...@@ -201,7 +197,6 @@ OC.Tags= {
} }
type = type ? type : this.type; type = type ? type : this.type;
var defer = $.Deferred(), var defer = $.Deferred(),
self = this,
url = OC.generateUrl( url = OC.generateUrl(
'/tags/{type}/favorite/{id}/', '/tags/{type}/favorite/{id}/',
{type: type, id: id} {type: type, id: id}
...@@ -228,7 +223,6 @@ OC.Tags= { ...@@ -228,7 +223,6 @@ OC.Tags= {
} }
type = type ? type : this.type; type = type ? type : this.type;
var defer = $.Deferred(), var defer = $.Deferred(),
self = this,
url = OC.generateUrl( url = OC.generateUrl(
'/tags/{type}/unfavorite/{id}/', '/tags/{type}/unfavorite/{id}/',
{type: type, id: id} {type: type, id: id}
...@@ -255,7 +249,6 @@ OC.Tags= { ...@@ -255,7 +249,6 @@ OC.Tags= {
} }
type = type ? type : this.type; type = type ? type : this.type;
var defer = $.Deferred(), var defer = $.Deferred(),
self = this,
url = OC.generateUrl('/tags/{type}/add', {type: type}); url = OC.generateUrl('/tags/{type}/add', {type: type});
$.post(url,{tag:tag}, function(response) { $.post(url,{tag:tag}, function(response) {
if(typeof cb == 'function') { if(typeof cb == 'function') {
...@@ -282,12 +275,10 @@ OC.Tags= { ...@@ -282,12 +275,10 @@ OC.Tags= {
} }
type = type ? type : this.type; type = type ? type : this.type;
var defer = $.Deferred(), var defer = $.Deferred(),
self = this,
url = OC.generateUrl('/tags/{type}/delete', {type: type}); url = OC.generateUrl('/tags/{type}/delete', {type: type});
if(!tags || !tags.length) { if(!tags || !tags.length) {
throw new Error(t('core', 'No tags selected for deletion.')); throw new Error(t('core', 'No tags selected for deletion.'));
} }
var self = this;
$.post(url, {tags:tags}, function(response) { $.post(url, {tags:tags}, function(response) {
if(response.status === 'success') { if(response.status === 'success') {
defer.resolve(response.tags); defer.resolve(response.tags);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment