Create Outcomes: Make "New Outcome" go away when clicked

When creating a new outcome, the default title is "New Outcome".  In
almost every case, the user wants to change the title.  When they click
the text box, we will now erase the default title for them.  We only do
this the first time it is created, so if the outcome is saved with the
default title of "New Outcome" we won't wipe out the title the next time
it is edited

Fixes CNVS-16763

Test Plan:

    - Create an outcome
    - Click in the title text box
    - Observe that the title is a placeholder that disappears when you
      start typing

Change-Id: If39c3aaef375254f57d6759fbde801711ddab142
Reviewed-on: https://gerrit.instructure.com/44066
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Hilary Scharton <hilary@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Adam Stone <astone@instructure.com>
This commit is contained in:
Benjamin Porter 2014-11-06 18:19:25 -07:00
parent 957e21be15
commit 20a1406c9a
2 changed files with 2 additions and 3 deletions

View File

@ -40,7 +40,7 @@ define [
addOutcome: (e) =>
e.preventDefault()
model = new Outcome title: I18n.t('new_outcome', 'New Outcome')
model = new Outcome title: ''
@trigger 'add', model
addGroup: (e) =>

View File

@ -1,12 +1,11 @@
<form action="{{url}}" class="learning_outcome" method="post">
<label class="span3" for="title">{{#t "title"}}Name this outcome{{/t}}:</label>
<input class="outcome_title span3" name="title" id=title size="50" type="text" value="{{title}}">
<input class="outcome_title span3" name="title" id=title size="50" type="text" value="{{title}}" placeholder="{{#t}}New Outcome{{/t}}">
<label class="span3" for="display_name">{{#t "display_name"}}Friendly name (optional){{/t}}:</label>
<input class="outcome_display_name span3" name="display_name" id=display_name size="50" type="text" value="{{display_name}}">
<label for="description">{{#t "description"}}Describe this outcome{{/t}}:</label>
<textarea cols="40" name="description" id=description rows="20" style="width: 100%; height: 150px;">{{description}}</textarea>
<div id="outcome_criterion_dialog" style="display: none;">