From 0311a338148fbfcfa049ef3645cbed70c12bbf68 Mon Sep 17 00:00:00 2001 From: j Date: Sun, 17 Jan 2016 17:01:30 +0530 Subject: [PATCH] only switch button to transferring after download api returns --- static/js/infoView.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/static/js/infoView.js b/static/js/infoView.js index 7d03cb4..3fc1042 100644 --- a/static/js/infoView.js +++ b/static/js/infoView.js @@ -184,10 +184,12 @@ oml.ui.infoView = function(externalData, isMixed) { }) .bindEvent({ click: function() { - data.mediastate = 'transferring'; - that.updateElement(data, $data); + var _this = this; + this.options({disabled: true}); oml.api.download({id: ui.item}, function(result) { - // ... + _this.options({disabled: false}); + data.mediastate = 'transferring'; + that.updateElement(data, $data); }); } }),