fix audience

This commit is contained in:
Galen Wolfe-Pauly 2015-05-08 15:56:33 -07:00
parent 5a0d576bd3
commit 4f1a7b537b
2 changed files with 11 additions and 7 deletions

View File

@ -55,8 +55,7 @@ module.exports = recl
$('#audi').focus()
return
if @state.audi.length is 0 and $('#audi').text().trim().length > 0
audi = @state.ludi
@_setAudi()
audi = if @_setAudi() then @_setAudi() else @state.ludi
else
audi = @state.audi
audi = @addCC audi
@ -138,10 +137,13 @@ module.exports = recl
if valid is true
v = $('#audi').text()
v = v.split " "
v = window.util.expandAudi v
for k,_v of v
if _v[0] isnt "~" then v[k] = "~#{_v}"
v = window.util.expandAudi v
StationActions.setAudience v
v
else
false
getTime: ->
d = new Date()

View File

@ -720,8 +720,7 @@ module.exports = recl({
return;
}
if (this.state.audi.length === 0 && $('#audi').text().trim().length > 0) {
audi = this.state.ludi;
this._setAudi();
audi = this._setAudi() ? this._setAudi() : this.state.ludi;
} else {
audi = this.state.audi;
}
@ -806,14 +805,17 @@ module.exports = recl({
if (valid === true) {
v = $('#audi').text();
v = v.split(" ");
v = window.util.expandAudi(v);
for (k in v) {
_v = v[k];
if (_v[0] !== "~") {
v[k] = "~" + _v;
}
}
return StationActions.setAudience(v);
v = window.util.expandAudi(v);
StationActions.setAudience(v);
return v;
} else {
return false;
}
},
getTime: function() {