Commit 3c046cc4 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Merge pull request #7426 from Razer6/rtrim_note_input

rtrim() input before checking if note form is empty
parents dbb1cb30 2cb7bf71
...@@ -58,10 +58,10 @@ window.disableButtonIfEmptyField = (field_selector, button_selector) -> ...@@ -58,10 +58,10 @@ window.disableButtonIfEmptyField = (field_selector, button_selector) ->
field = $(field_selector) field = $(field_selector)
closest_submit = field.closest("form").find(button_selector) closest_submit = field.closest("form").find(button_selector)
closest_submit.disable() if field.val() is "" closest_submit.disable() if field.val().replace(/\s+$/, "") is ""
field.on "input", -> field.on "input", ->
if $(@).val() is "" if $(@).val().replace(/\s+$/, "") is ""
closest_submit.disable() closest_submit.disable()
else else
closest_submit.enable() closest_submit.enable()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment