mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
fix firefox focus bug on flagging dialog
This commit is contained in:
@@ -6,18 +6,21 @@
|
||||
<label class='radio'>
|
||||
<input type='radio' id="radio_{{unbound name_key}}" {{action changePostActionType this target="view"}} name='post_action_type_index'> <strong>{{name}}</strong>
|
||||
{{#if is_custom_flag}}
|
||||
{{#if view.isCustomFlag}}
|
||||
{{view Ember.TextArea name="message" class="flag-message" placeholderBinding="view.customPlaceholder" valueBinding="view.customFlagMessage"}}
|
||||
<div {{bindAttr class="view.customMessageLengthClasses"}}>{{view.customMessageLength}}</div>
|
||||
{{else}}
|
||||
{{#unless view.isCustomFlag}}
|
||||
<div class='description'>{{{description}}}</div>
|
||||
{{/if}}
|
||||
{{/unless}}
|
||||
{{else}}
|
||||
{{#if description}}
|
||||
<div class='description'>{{{description}}}</div>
|
||||
{{/if}}
|
||||
{{/if}}
|
||||
</label>
|
||||
{{#if is_custom_flag}}
|
||||
{{#if view.isCustomFlag}}
|
||||
{{view Ember.TextArea name="message" class="flag-message" placeholderBinding="view.customPlaceholder" valueBinding="view.customFlagMessage"}}
|
||||
<div {{bindAttr class="view.customMessageLengthClasses"}}>{{view.customMessageLength}}</div>
|
||||
{{/if}}
|
||||
{{/if}}
|
||||
</div>
|
||||
{{/each}}
|
||||
</form>
|
||||
|
||||
@@ -3,6 +3,8 @@ window.Discourse.FlagView = Ember.View.extend
|
||||
title: Em.String.i18n('flagging.title')
|
||||
|
||||
changePostActionType: (action) ->
|
||||
if @get('postActionTypeId') == action.id
|
||||
return false
|
||||
@set('postActionTypeId', action.id)
|
||||
@set('isCustomFlag', action.is_custom_flag)
|
||||
Em.run.next -> $("#radio_#{action.name_key}").prop('checked', 'true')
|
||||
@@ -40,7 +42,7 @@ window.Discourse.FlagView = Ember.View.extend
|
||||
message = Em.String.i18n("flagging.custom_message.left", n: 500 - len)
|
||||
@set("customMessageLengthClasses", "ok custom-message-length")
|
||||
@set("customMessageLength",message)
|
||||
|
||||
return
|
||||
).observes("customFlagMessage")
|
||||
|
||||
didInsertElement: ->
|
||||
@@ -51,3 +53,4 @@ window.Discourse.FlagView = Ember.View.extend
|
||||
# Would be nice if there were an EmberJs radio button to do this for us. Oh well, one should be coming
|
||||
# in an upcoming release.
|
||||
$("input[type='radio']", $flagModal).prop('checked', false)
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user