fix replacing hours/minutes when editing date picker fields; fixes #5903
Change-Id: Ide4048c41bc670004c3915c4c526b980eafed4ac Reviewed-on: https://gerrit.instructure.com/6121 Tested-by: Hudson <hudson@instructure.com> Reviewed-by: JT Olds <jt@instructure.com> Reviewed-by: Ryan Shaw <ryan@instructure.com>
This commit is contained in:
parent
8a5ab4be08
commit
77681054a5
|
@ -280,21 +280,18 @@ I18n.scoped('instructure', function(I18n) {
|
||||||
var cur = $.datepicker._curInst;
|
var cur = $.datepicker._curInst;
|
||||||
if(cur) {
|
if(cur) {
|
||||||
var val = $(this).val();
|
var val = $(this).val();
|
||||||
$(this).val(val);
|
|
||||||
cur.input.data('time-hour', val);
|
cur.input.data('time-hour', val);
|
||||||
}
|
}
|
||||||
}).delegate(".ui-datepicker-time-minute", 'change keypress focus blur', function(event) {
|
}).delegate(".ui-datepicker-time-minute", 'change keypress focus blur', function(event) {
|
||||||
var cur = $.datepicker._curInst;
|
var cur = $.datepicker._curInst;
|
||||||
if(cur) {
|
if(cur) {
|
||||||
var val = $(this).val();
|
var val = $(this).val();
|
||||||
$(this).val(val);
|
|
||||||
cur.input.data('time-minute', val);
|
cur.input.data('time-minute', val);
|
||||||
}
|
}
|
||||||
}).delegate(".ui-datepicker-time-ampm", 'change keypress focus blur', function(event) {
|
}).delegate(".ui-datepicker-time-ampm", 'change keypress focus blur', function(event) {
|
||||||
var cur = $.datepicker._curInst;
|
var cur = $.datepicker._curInst;
|
||||||
if(cur) {
|
if(cur) {
|
||||||
var val = $(this).val();
|
var val = $(this).val();
|
||||||
$(this).val(val);
|
|
||||||
cur.input.data('time-ampm', val);
|
cur.input.data('time-ampm', val);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
@ -25,6 +25,27 @@ describe "jquery ui selenium tests" do
|
||||||
driver.find_element(:css, ".ui-widget-overlay").should be_displayed
|
driver.find_element(:css, ".ui-widget-overlay").should be_displayed
|
||||||
end
|
end
|
||||||
|
|
||||||
|
context "calendar widget" do
|
||||||
|
it "should let you replace content by selecting and typing instead of appending" do
|
||||||
|
get "/courses/#{@course.id}/assignments"
|
||||||
|
|
||||||
|
driver.find_element(:css, "a.add_assignment_link").click
|
||||||
|
wait_for_animations
|
||||||
|
driver.find_element(:css, ".ui-datepicker-trigger").click
|
||||||
|
wait_for_animations
|
||||||
|
driver.find_element(:css, ".ui-datepicker-time-hour").send_keys("12")
|
||||||
|
driver.find_element(:css, ".ui-datepicker-time-minute").send_keys("00")
|
||||||
|
driver.find_element(:css, ".ui-datepicker-ok").click
|
||||||
|
|
||||||
|
driver.find_element(:css, ".ui-datepicker-trigger").click
|
||||||
|
wait_for_animations
|
||||||
|
|
||||||
|
driver.execute_script("$('#ui-datepicker-time-hour').select();")
|
||||||
|
driver.find_element(:id, "ui-datepicker-time-hour").send_keys('5')
|
||||||
|
driver.find_element(:id, "ui-datepicker-time-hour").attribute('value').should == "5"
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
context "dialog titles" do
|
context "dialog titles" do
|
||||||
|
|
||||||
# jquery ui doesn't escape dialog titles by default (even when inferred from
|
# jquery ui doesn't escape dialog titles by default (even when inferred from
|
||||||
|
|
Loading…
Reference in New Issue