BUGFIX: remote upload dialog was broken

This commit is contained in:
Régis Hanol 2014-01-18 15:48:39 +01:00
parent 9b3eb0d201
commit 86214989f5
2 changed files with 9 additions and 4 deletions

View File

@ -8,8 +8,13 @@
@module Discourse @module Discourse
**/ **/
Discourse.UploadSelectorController = Discourse.Controller.extend(Discourse.ModalFunctionality, { Discourse.UploadSelectorController = Discourse.Controller.extend(Discourse.ModalFunctionality, {
local: Em.computed.not("remote"), remote: Em.computed.not("local"),
remote: Em.computed.not("allowLocal"), local: false,
init: function() {
this._super();
this.set("local", this.get("allowLocal"));
},
allowLocal: function() { allowLocal: function() {
return Discourse.SiteSettings.max_attachment_size_kb > 0; return Discourse.SiteSettings.max_attachment_size_kb > 0;

View File

@ -3,7 +3,7 @@
<div class="radios"> <div class="radios">
<input type="radio" id="local" value="local" name="upload" {{action useLocal}}> <input type="radio" id="local" value="local" name="upload" {{action useLocal}}>
<label class="radio" for="local">{{i18n upload_selector.from_my_computer}}</label> <label class="radio" for="local">{{i18n upload_selector.from_my_computer}}</label>
{{#if controller.local}} {{#if local}}
<div class="inputs"> <div class="inputs">
<input type="file" id="filename-input"><br> <input type="file" id="filename-input"><br>
<span class="description">{{unbound view.tip}}</span> <span class="description">{{unbound view.tip}}</span>
@ -14,7 +14,7 @@
<div class="radios"> <div class="radios">
<input type="radio" id="remote" value="remote" name="upload" {{action useRemote}}> <input type="radio" id="remote" value="remote" name="upload" {{action useRemote}}>
<label class="radio" for="remote">{{i18n upload_selector.from_the_web}}</label> <label class="radio" for="remote">{{i18n upload_selector.from_the_web}}</label>
{{#if controller.remote}} {{#if remote}}
<div class="inputs"> <div class="inputs">
<input type="text" id="fileurl-input"><br> <input type="text" id="fileurl-input"><br>
<span class="description">{{unbound view.tip}}</span> <span class="description">{{unbound view.tip}}</span>