don't call jquery UI methods an elements with no widget initialized

aka: no more .dialog('close').dialog({}).dialog('open')
(does not actually change any behavior visible to end user)

test plan:

as far as manual testing goes, try to go to a bunch of pages that have dialogs
and open and close them.

For engineers, if you can think of other places where we might try to set options
on a UI widget before we initialize one (like sortables or something), check that too.

Change-Id: I7415c00d8c15b562ac12eeef83fa041aff1dfb35
Reviewed-on: https://gerrit.instructure.com/12810
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jon Jensen <jon@instructure.com>
This commit is contained in:
Ryan Shaw 2012-08-08 12:22:01 -06:00
parent b114155395
commit 81dc9b769e
57 changed files with 232 additions and 334 deletions

View File

@ -128,12 +128,9 @@ define [
openHelpDialog: (e) =>
e.preventDefault()
$("#options_help_dialog").dialog('close').dialog(
autoOpen: false
$("#options_help_dialog").dialog
title: I18n.t('affect_reservations', "How will this affect reservations?")
width: 400
).dialog('open')
saveWithoutPublishingClick: (jsEvent) =>
jsEvent.preventDefault()

View File

@ -536,7 +536,7 @@ define [
$(this).closest('li').data('id')
$preview.find('> li').last().addClass('last')
@$forwardForm.css('max-height', ($(window).height() - 300) + 'px')
.dialog('close').dialog
.dialog
position: 'center'
height: 'auto'
width: 510
@ -565,7 +565,7 @@ define [
return unless @conversations.active()?
@$addForm
.attr('action', @conversations.actionUrlFor($(e.currentTarget)))
.dialog('close').dialog
.dialog
width: 420
title: I18n.t('title.add_recipients', 'Add Recipients')
buttons: [

View File

@ -65,14 +65,14 @@ define [
$key = $(this).closest(".key")
key = $key.data('key')
$form = buildForm(key, $key)
$("#edit_dialog").empty().append($form).dialog('close').dialog('open')
$("#edit_dialog").empty().append($form).dialog('open')
)
$(".add_key").click((event) ->
event.preventDefault()
$form = buildForm()
$("#edit_dialog").empty().append($form).dialog('close').dialog('open')
$("#edit_dialog").empty().append($form).dialog('open')
)
$("#edit_dialog").html(developer_key_form({})).dialog('close').dialog({
$("#edit_dialog").html(developer_key_form({})).dialog({
autoOpen: false,
width: 350
}).on('click', '.cancel', () ->

View File

@ -106,11 +106,10 @@ require([
function testLDAP() {
clearTestLDAP();
$("#test_ldap_dialog").dialog('close').dialog({
autoOpen: false,
$("#test_ldap_dialog").dialog({
title: <%= jt('#accounts.test_ldap_dialog_title', "Test LDAP Settings") %>,
width: 500
}).dialog('open');
});
<%= ldap_tests.first.js_function %>();
}
function clearTestLDAP() {

View File

@ -122,11 +122,10 @@ require([
$(".add_user_link").click(function(event) {
event.preventDefault();
$("#add_user_form :text").val("");
$("#add_user_dialog").dialog('close').dialog({
autoOpen: false,
$("#add_user_dialog").dialog({
title: <%= jt('#accounts.add_user_dialog_title', "Add a New User") %>,
width: 500
}).dialog('open');
});
$("#add_user_form :text:visible:first").focus().select();
});
$("#add_user_form").formSubmit({
@ -160,11 +159,10 @@ require([
$(".add_course_link").click(function(event) {
event.preventDefault();
$("#add_course_form :text").val("");
$("#add_course_dialog").dialog('close').dialog({
$("#add_course_dialog").dialog({
title: <%= jt('#accounts.add_course_dialog_title', "Add a New Course") %>,
autoOpen: false,
width: 500
}).dialog('open');
});
$("#add_course_form :text:visible:first").focus().select();
});
$("#add_course_form").formSubmit({

View File

@ -49,7 +49,7 @@ $("#question_bank_select").change(function() {
});
$(".overwrite_questions_description_link").click(function(event) {
event.preventDefault();
$('#overwrite_questions_description').dialog('close').dialog({
$('#overwrite_questions_description').dialog({
title: 'Overwrite Assessment Data',
width: 500
});

View File

@ -105,10 +105,9 @@ require([
$(document).ready(function() {
$(".self_unenrollment_link").click(function(event) {
$("#self_unenrollment_dialog").dialog('close').dialog({
autoOpen: false,
$("#self_unenrollment_dialog").dialog({
title: <%= raw t('titles.drop_course', "Drop this Course").to_json %>
}).dialog('open');
});
});
$("#self_unenrollment_dialog .action").click(function() {
$("#self_unenrollment_dialog a.button").attr('disabled', true);
@ -118,10 +117,9 @@ $(document).ready(function() {
$("#self_enrollment_dialog").dialog('close');
});
$(".self_enrollment_link").click(function(event) {
$("#self_enrollment_dialog").dialog('close').dialog({
autoOpen: false,
$("#self_enrollment_dialog").dialog({
title: <%= raw t('titles.join_course', "Join this Course").to_json %>
}).dialog('open');
});
});
$("#self_enrollment_dialog .action").click(function() {
$("#self_enrollment_dialog a.button").attr('disabled', true);

View File

@ -524,13 +524,12 @@ window.contexts = <%= raw @contexts.to_json(:permissions => {:user => @current_u
INST.downloadFolderFiles = function(url) {
var cancelled = false;
$("#download_folder_files_dialog .status_box .status").text(<%= jt('#files.messages.gathering_data', "Gathering data...") %>);
$("#download_folder_files_dialog").dialog('close').dialog({
autoOpen: false,
$("#download_folder_files_dialog").dialog({
title: <%= jt('#files.titles.download_folder_contents', "Download Folder Contents") %>,
close: function() {
cancelled = true;
}
}).dialog('open');
});
$("#download_folder_files_dialog .progress").progressbar({value: 0});
var checkForChange = function() {
if(cancelled || $("#download_folder_files_dialog:visible").length == 0) { return; }

View File

@ -6,8 +6,7 @@ require([
'jqueryui/dialog'
], function(I18n, $) {
window.addGroupCategory = function(callback) {
$("#add_category_form").dialog('close').dialog({
autoOpen: false,
$("#add_category_form").dialog({
width: "auto",
title: <%= jt('#groups.titles.add_group_category', 'Add Set of Groups') %>,
modal: true,
@ -15,7 +14,7 @@ require([
backgroundColor: "#000",
opacity: 0.7
}
}).dialog('open');
});
var callbacks = $("#add_category_form").data('callbacks') || [];
callbacks.push(callback);
$("#add_category_form").data('callbacks', callbacks);

View File

@ -327,10 +327,10 @@ $(document).ready(function() {
this.elements.$dialog.find('li message').hide();
}
this.elements.$dialog.dialog('close').dialog({
this.elements.$dialog.dialog({
title: this.messages.move_copy_questions,
width: 600
}).dialog('open');
});
},
loadData: function(){
this.elements.$questions.append(this.elements.$loadMessage);
@ -368,10 +368,10 @@ $(document).ready(function() {
data: template
});
$dialog.data('question', $(this).parents(".question_holder"));
$dialog.dialog('close').dialog({
$dialog.dialog({
width: 600,
title: <%= jt('title.move_copy_questions', "Move/Copy Questions") %>
}).dialog('open');
});
});
$("#move_question_dialog .submit_button").click(function() {
var $dialog = $("#move_question_dialog");

View File

@ -283,12 +283,11 @@ $(document).ready(function() {
answer_text: answer_text,
question_name: question_name
}});
$dialog.dialog('close').dialog({
autoOpen: false,
$dialog.dialog({
title: <%= jt('titles.submitted_users_for_quesiton', "Submitted Users for %{user}", '{\'user\': question_name}') %>,
width: 500,
height: 300
}).dialog('open');
});
}
});
});

View File

@ -46,14 +46,13 @@ $(document).ready(function() {
}).change();
$("#uploading_progressbar").progressbar();
$("#zip_file_import_form").submit(function(){
$("#uploading_please_wait_dialog").dialog('close').dialog({
$("#uploading_please_wait_dialog").dialog({
bgiframe: true,
width: 400,
modal: true,
autoOpen: false,
closeOnEscape: false,
dialogClass: "ui-dialog-no-close-button"
}).dialog('open');
});
return true;
});
var $frame = $("<iframe id='import_frame' name='import_frame'/>")

View File

@ -11,13 +11,12 @@ require([
INST.downloadSubmissions = function(url) {
var cancelled = false;
$("#download_submissions_dialog").dialog('close').dialog({
autoOpen: false,
$("#download_submissions_dialog").dialog({
title: <%= jt("#submissions.download_submissions", "Download Assignment Submissions") %>,
close: function() {
cancelled = true;
}
}).dialog('open');
});
$("#download_submissions_dialog .progress").progressbar({value: 0});
var checkForChange = function() {
if(cancelled || $("#download_submissions_dialog:visible").length == 0) { return; }

View File

@ -73,19 +73,17 @@ define([
}
$(".ip_help_link").click(function(event) {
event.preventDefault();
$("#ip_filters_dialog").dialog('close').dialog({
autoOpen: false,
$("#ip_filters_dialog").dialog({
title: I18n.t('titles.what_are_quiz_ip_filters', "What are Quiz IP Filters?"),
width: 400
}).dialog('open');
});
});
$(".open_registration_delegated_warning_link").click(function(event) {
event.preventDefault();
$("#open_registration_delegated_warning_dialog").dialog('close').dialog({
autoOpen: false,
$("#open_registration_delegated_warning_dialog").dialog({
title: I18n.t('titles.open_registration_delegated_warning_dialog', "An External Identity Provider is Enabled"),
width: 400
}).dialog('open');
});
});
@ -165,7 +163,7 @@ define([
$(".open_report_description_link").click(function(event) {
event.preventDefault();
var title = $(this).parents(".title").find("span.title").text();
$(this).parent(".reports").find(".report_description").dialog('close').dialog({
$(this).parent(".reports").find(".report_description").dialog({
title: title,
width: 800
});

View File

@ -40,11 +40,11 @@ define([
});
});
function populateDialog(data_points, axis) {
$("#over_time_dialog").dialog('close').dialog({
autoOpen: false,
$("#over_time_dialog").dialog({
width: 630,
height: 330
}).dialog('open').dialog('option', 'title', I18n.t('title_data_point_over_time', "%{data_point} Over Time", {data_point: axis}));
height: 330,
title: I18n.t('title_data_point_over_time', "%{data_point} Over Time", {data_point: axis})
});
// google dependencies declared in views/acccounts/statistics since google.load uses document.write :(
var data = new google.visualization.DataTable();

View File

@ -85,11 +85,10 @@ $(document).ready(function() {
});
$("#align_outcomes_dialog .outcome_checkbox").each(function() { $(this).change(); });
$("#aligned_outcomes_mastery_score").val(mastery);
$("#align_outcomes_dialog").dialog('close').dialog({
autoOpen: false,
$("#align_outcomes_dialog").dialog({
title: I18n.t('buttons.align_outcomes', 'Align Outcomes'),
width: 500
}).dialog('open');
});
});
$("#align_outcomes_dialog .cancel_button").click(function() {
$("#align_outcomes_dialog").dialog('close');

View File

@ -665,10 +665,9 @@ define([
});
$dialog.find(".group_select")[0].selectedIndex = 0;
$dialog.find("#assignment_group_delete").attr('checked', true);
$dialog.dialog('close').dialog({
autoOpen: false,
$dialog.dialog({
width: 500
}).dialog('open').data('group_id', data.assignment_group_id);
}).data('group_id', data.assignment_group_id);
return;
}
$group.confirmDelete({
@ -931,9 +930,8 @@ define([
object_name: "assignment"
}).attr('action', $assignment.find(".assignment_url").attr('href'));
var height = Math.max(Math.round($(window).height() * 0.8), 400);
$("#full_assignment_holder").dialog('close').dialog({
$("#full_assignment_holder").dialog({
title: I18n.t('titles.assignment_details', "Assignment Details"),
autoOpen: false,
width: 630,
height: height,
modal: true,
@ -944,7 +942,7 @@ define([
backgroundColor: "#000",
opacity: 0.7
}
}).dialog('open');
});
$("#full_assignment").show();
});
$(document).keycodes('j k', function(event) {

View File

@ -139,10 +139,9 @@ define([
$("#new_assignment_dialog :text:not(.points_possible)").each(function() {
$(this).val("");
});
$("#new_assignment_dialog").dialog('close').dialog({
autoOpen: false,
$("#new_assignment_dialog").dialog({
title: I18n.t('titles.new_attendance_column', "New Attendance Column")
}).dialog('open');
});
});
$("#new_assignment_dialog .cancel_button").click(function(event) {
$("#new_assignment_dialog").dialog('close');
@ -194,11 +193,10 @@ define([
$(".datetime_field").datetime_field();
$(".help_link").click(function(event) {
event.preventDefault();
$("#attendance_how_to_dialog").dialog('close').dialog({
autoOpen: false,
$("#attendance_how_to_dialog").dialog({
width: 400,
title: I18n.t('titles.attendance_help', "Attendance Help")
}).dialog('open');
});
});
$(".submission").addClass('loading');
var getClump = function(url, assignment_ids, user_ids) {

View File

@ -632,7 +632,8 @@ define([
})
}
function showEvent($event, $day) {
var $box = $("#event_details");
var $box = $("#event_details"),
$editEvent = $('#edit_event');
var data = $.extend({}, $event.getTemplateData({
textValues: ['id', 'start_time_string', 'end_time_string', 'start_date_string', 'title', 'event_type', 'can_edit', 'can_delete', 'context_id', 'context_type', 'all_day'],
htmlValues: ['description']
@ -695,11 +696,10 @@ define([
if (data.lock_info) {
$box.find(".lock_explanation").html(INST.lockExplanation(data.lock_info, 'assignment'));
}
$("#edit_event").dialog('close');
$("#event_details").dialog('close');
$("#event_details").find(".description").css("max-height", Math.max($(window).height() - 200, 150));
if ($editEvent.data('dialog')) $editEvent.dialog('close');
$box.find(".description").css("max-height", Math.max($(window).height() - 200, 150));
var title = type_name == "Event" ? I18n.t('event_details', "Event Details") : I18n.t('assignment_details', "Assignment Details");
$("#event_details").show().dialog({
$box.dialog({
title: title,
width: (data.description.length > 2000 ? Math.max($(window).width() - 300, 450) : 450),
resizable: true,
@ -710,9 +710,8 @@ define([
},
open: function() {
$(document).triggerHandler('event_dialog', $(this));
},
autoOpen: false
}).dialog('open').dialog('option', 'title', title);
}
});
$event.addClass('selected');
selectDateForEvent($day.parents(".calendar_day_holder"));
}
@ -762,8 +761,8 @@ define([
}
}
function editEvent($event, $day) {
var $box = $("#edit_event");
$("#edit_event_tabs").show();
var $box = $("#edit_event"),
$eventDetails = $('#event_details');
var data = $.extend({}, $event.data('event_data'), $event.getTemplateData({ textValues: [ 'title' ] }));
data.description = $event.data('description');
data.context_type = data.context_type || "";
@ -803,11 +802,11 @@ define([
data.event_type == "calendar_event";
}
var selectedTabIndex = 0;
var $assignmentForm = $box.find("#edit_assignment_form").show();
var $assignmentForm = $box.find("#edit_assignment_form");
$assignmentForm.find("select.context_id").val(context);
setFormURLs($assignmentForm, context, data.id);
var $eventForm = $box.find("#edit_calendar_event_form").show();
var $eventForm = $box.find("#edit_calendar_event_form");
$eventForm.find("select.context_id").val(context);
setFormURLs($eventForm, context, data.id);
@ -824,8 +823,7 @@ define([
$("#edit_calendar_event_form").data('current_event', $event);
$("#edit_assignment_form").fillFormData(data, {object_name: 'assignment'});
$("#edit_calendar_event_form").fillFormData(data, {object_name: 'calendar_event'});
$("#event_details").dialog('close');
$("#edit_event").dialog('close');
if ($eventDetails.data('dialog')) $eventDetails.dialog('close');
selectDateForEvent($day.parents(".calendar_day_holder"));
var title;
if (isNew) {
@ -833,7 +831,7 @@ define([
} else {
title = type_name == "Event" ? I18n.t('titles.edit_event', "Edit Event") : I18n.t('titles.edit_assignment', "Edit Assignment");
}
$("#edit_event").show().dialog({
$box.dialog({
title: title,
width: 400,
open: function() {
@ -930,10 +928,9 @@ define([
}
$form.find("input[name='date']").datepicker('hide');
},
autoOpen: false,
resizable: false,
modal: true
}).dialog('open').dialog('option', 'title', title);
});
// if we know the context that the event is being edited for, color the box that contex's color
if (data.context_id && data.context_type) {
@ -1100,11 +1097,10 @@ define([
event.preventDefault();
$("#calendar_feed_box").find(".calendar_feed_url").val($(this).attr('href')).end()
.find(".show_calendar_feed_link").attr('href', $(this).attr('href'));
$("#calendar_feed_box").dialog('close').dialog({
$("#calendar_feed_box").dialog({
title: I18n.t('feed_dialog_title', "Calendar Feed"),
width: 375,
autoOpen: false
}).dialog('open');
width: 375
});
});
$("#calendar_feed_box .calendar_feed_url").focus(function() {
$(this).select();

View File

@ -88,11 +88,10 @@ define([
var $collaboration = $(this).parents(".collaboration");
if($(this).parents(".collaboration").hasClass('google_docs')) {
$("#delete_collaboration_dialog").data('collaboration', $collaboration);
$("#delete_collaboration_dialog").dialog('close').dialog({
autoOpen: false,
$("#delete_collaboration_dialog").dialog({
title: "Delete Collaboration?",
width: 350
}).dialog('open');
});
} else {
$collaboration.confirmDelete({
message: "Are you sure you want to delete this collaboration?",

View File

@ -40,7 +40,7 @@ $(document).ready(function() {
$(".add_email_link,.add_contact_link").click(function(event) {
event.preventDefault();
var view = "email";
$("#communication_channels").show().dialog('close').dialog({
$("#communication_channels").show().dialog({
title: I18n.t('titles.register_communication', "Register Communication") ,
width: 430,
resizable: false,
@ -48,7 +48,7 @@ $(document).ready(function() {
open: function() {
$("#communication_channels").triggerHandler('tabsshow');
}
}).dialog('open');
});
if($(this).hasClass('add_contact_link')) {
$("#communication_channels").tabs('select', '#register_sms_number');
view = "sms";
@ -176,14 +176,13 @@ $(document).ready(function() {
$box.find(".re_send_confirmation_link").attr('href', url)
.text( I18n.t('links.resend_confirmation', "Re-Send Confirmation") );
$box.fillFormData(data);
$box.show().dialog('close').dialog({
autoOpen: false,
$box.show().dialog({
title: confirm_title,
width: 350,
open: function() {
$(this).find(":text:first").focus().select();
}
}).dialog('open');
});
}
});
$("#confirm_communication_channel").formSubmit({

View File

@ -204,15 +204,14 @@ define([
$a.text(data[i].name);
$box.append($a).append("<br>");
}
$box.dialog('close').dialog({
autoOpen: false,
$box.dialog({
width: 425,
minWidth: 425,
minHeight: 215,
resizable: true,
height: "auto",
title: $self.text()
}).dialog('open');
});
} else {
window.open(data[0].url);
}

View File

@ -124,10 +124,9 @@ define([
});
}
$dialog.find(".lock_reason_content").empty().append($reason);
$dialog.dialog('close').dialog({
autoOpen: false,
$dialog.dialog({
title: I18n.t('titles.content_is_locked', "Content Is Locked")
}).dialog('open');
});
}
});
});

View File

@ -241,7 +241,7 @@ define([
});
$module.addClass('dont_remove');
$form.find(".module_name").toggleClass('lonely_entry', isNew);
$form.dialog('close').dialog({
$form.dialog({
autoOpen: false,
modal: true,
width: 600,
@ -651,10 +651,9 @@ define([
$("#edit_item_form").find(".external_tool").showIf($item.hasClass('context_external_tool'));
$("#edit_item_form").attr('action', $(this).attr('href'));
$("#edit_item_form").fillFormData(data, {object_name: 'content_tag'});
$("#edit_item_form").dialog('close').dialog({
autoOpen: false,
$("#edit_item_form").dialog({
title: I18n.t('titles.edit_item', "Edit Item Details")
}).dialog('open');
});
});
$("#edit_item_form .cancel_button").click(function(event) {
$("#edit_item_form").dialog('close');
@ -802,11 +801,10 @@ define([
$select.find(".context_module_" + afters[idx]).attr('disabled', true);
}
$("#add_module_prerequisite_dialog").find(".prerequisite_module_select").empty().append($select.show());
$("#add_module_prerequisite_dialog").dialog('close').dialog({
autoOpen: true,
$("#add_module_prerequisite_dialog").dialog({
title: I18n.t('titles.add_prerequisite', 'Add Prerequisite to %{module}', {'module': module.name}),
width: 400
}).dialog('open');
});
});
$("#add_context_module_form .cancel_button").click(function(event) {
modules.hideEditModule(true);
@ -1129,13 +1127,12 @@ define([
$dialog.find(".side_tabs_content tbody").append($template.show());
});
$("#student_progression_dialog").dialog('close').dialog({
autoOpen: false,
$("#student_progression_dialog").dialog({
width: 800,
open: function() {
$(this).find(".student:not(.blank):first .name").click();
}
}).dialog('open');
});
});
$(".context_module .progression_details_link").click(function(event) {
event.preventDefault();
@ -1153,11 +1150,10 @@ define([
$dialog.find("." + progressionData.workflow_state + "_list").show()
.find("ul").show().append($("<li />").text(progressionData.name));
});
$("#module_progression_dialog").dialog('close').dialog({
autoOpen: false,
$("#module_progression_dialog").dialog({
title: I18n.t('titles.student_progress', "Student Progress for Module"),
width: 500
}).dialog('open');
});
});
$(document).fragmentChange(function(event, hash) {
var module = $(hash.replace(/module/, "context_module"));

View File

@ -235,11 +235,11 @@ define([
$(".edit_nav_link").click(function(event) {
event.preventDefault();
$("#nav_form").dialog('close').dialog({
$("#nav_form").dialog({
modal: true,
resizable: false,
width: 400
}).dialog('open');
});
});
$("#nav_enabled_list, #nav_disabled_list").sortable({
@ -251,11 +251,10 @@ define([
$(".hashtag_dialog_link").click(function(event) {
event.preventDefault();
$("#hashtag_dialog").dialog('close').dialog({
autoOpen: false,
$("#hashtag_dialog").dialog({
title: I18n.t('titles.hashtag_help', "What's a Hashtag?"),
width: 500
}).dialog('open');
});
});
$(".close_dialog_button").click(function() {
$("#hashtag_dialog").dialog('close');
@ -294,11 +293,10 @@ define([
});
$(".move_course_link").click(function(event) {
event.preventDefault();
$("#move_course_dialog").dialog('close').dialog({
autoOpen: false,
$("#move_course_dialog").dialog({
title: I18n.t('titles.move_course', "Move Course"),
width: 500
}).dialog('open');
});
});
$("#move_course_dialog").delegate('.cancel_button', 'click', function() {
$("#move_course_dialog").dialog('close');
@ -461,11 +459,10 @@ define([
$(".reset_course_content_button").click(function(event) {
event.preventDefault();
$("#reset_course_content_dialog").dialog('close').dialog({
autoOpen: false,
$("#reset_course_content_dialog").dialog({
title: I18n.t('titles.reset_course_content_dialog_help', "Reset Course Content"),
width: 500
}).dialog('open');
});
});
$("#reset_course_content_dialog .cancel_button").click(function() {
$("#reset_course_content_dialog").dialog('close');

View File

@ -406,23 +406,21 @@ define([
.fillFormData(data)
.find(".editing").showIf(editing && !$criterion.hasClass('learning_outcome_criterion')).end()
.find(".displaying").showIf(!editing || $criterion.hasClass('learning_outcome_criterion')).end()
.dialog('close').dialog({
autoOpen: false,
.dialog({
title: I18n.t('titles.criterion_long_description', "Criterion Long Description"),
width: 400
}).dialog('open')
})
.find("textarea:visible:first").focus().select();
})
.delegate(".find_rubric_link", 'click', function(event) {
event.preventDefault();
$rubric_dialog.dialog('close').dialog({
autoOpen: true,
$rubric_dialog.dialog({
width: 800,
height: 380,
resizable: true,
title: I18n.t('titles.find_existing_rubric', 'Find Existing Rubric')
}).dialog('open');
});
if(!$rubric_dialog.hasClass('loaded')) {
$rubric_dialog.find(".loading_message").text(I18n.t('messages.loading_rubric_groups', "Loading rubric groups..."));
var url = $rubric_dialog.find(".grading_rubrics_url").attr('href');

View File

@ -75,11 +75,10 @@ define([
$(document).ready(function() {
$(".portfolio_settings_link").click(function(event) {
event.preventDefault();
$("#edit_eportfolio_form").dialog('close').dialog({
autoOpen: false,
$("#edit_eportfolio_form").dialog({
width: "auto",
title: I18n.t('eportfolio_settings', "ePortfolio Settings")
}).dialog('open');
});
});
$("#edit_eportfolio_form .cancel_button").click(function(event) {
$("#edit_eportfolio_form").dialog('close');
@ -394,15 +393,14 @@ define([
$("#add_submission_form .submission_description").val(
I18n.t('default_description', "This is my %{assignment} submission for %{course}.",
{ 'assignment': assignment, 'course': context }));
$("#add_submission_form").dialog('close').dialog({
autoOpen: false,
$("#add_submission_form").dialog({
title: I18n.t('titles.add_submission', 'Add Page for Submission'),
width: 400,
open: function() {
$(this).find(":text:visible:first").val(assignment).focus().select();
$(document).triggerHandler('submission_dialog_opened');
}
}).dialog('open');
});
}
});
$("#add_submission_form .cancel_button").click(function() {
@ -869,10 +867,9 @@ define([
check(true);
});
$(".download_eportfolio_link").click(function(event) {
$("#downloading_eportfolio_dialog").dialog('close').dialog({
autoOpen: false,
$("#downloading_eportfolio_dialog").dialog({
title: I18n.t('titles.download_eportfolio', "Download ePortfolio")
}).dialog('open');
});
});
});
});

View File

@ -23,12 +23,11 @@ $(document).ready(function() {
consumer_key: "",
shared_secret: ""
}
$dialog.dialog('close').dialog({
autoOpen: false,
$dialog.dialog({
title: I18n.t('titles.edit_external_tool', "Edit External Tool"),
width: 600,
height: 420
}).dialog('open');
});
$dialog.find(".shared_secret_note").hide();
$dialog.find("form")
.attr('method', 'POST')
@ -85,12 +84,11 @@ $(document).ready(function() {
.attr('method', 'PUT')
.attr('action', $tool.find(".update_tool_url").attr('rel'));
$dialog.fillFormData(data, {object_name: 'external_tool'});
$dialog.dialog('close').dialog({
autoOpen: false,
$dialog.dialog({
title: I18n.t('titles.edit_external_tool', "Edit External Tool"),
width: 600,
height: 420
}).dialog('open');
});
$dialog.find(".config_type_option").hide();
$("#external_tool_config_type").val('manual').change();
}).delegate('.delete_tool_link', 'click', function(event) {

View File

@ -79,13 +79,12 @@ var find_outcome = (function() {
} else {
find_outcome_title = I18n.t('titles.find_outcome', "Find Outcome");
}
$dialog.dialog('close').dialog({
autoOpen: false,
$dialog.dialog({
modal: true,
title: find_outcome_title,
width: 700,
height: 400
}).dialog('open');
});
}
}
})();

View File

@ -346,11 +346,10 @@ define([
$dialog.fillTemplateData({data: data, htmlValues: ( is_learning_outcome ? ['long_description'] : [] )});
$dialog.find(".editing").hide();
$dialog.find(".displaying").show();
$dialog.dialog('close').dialog({
autoOpen: false,
$dialog.dialog({
title: I18n.t('titles.criterion_long_description', "Criterion Long Description"),
width: 400
}).dialog('open');
});
}
});
$("#edit_external_tool_url, #assignment_external_tool_tag_attributes_url").click(function(event) {

View File

@ -155,8 +155,7 @@ define([
var $progress = $dialog.find(".progress");
$progress.css('margin', '10px');
$progress.progressbar();
$dialog.dialog('close').dialog({
autoOpen: false,
$dialog.dialog({
title: I18n.t('titles.extracting', "Extracting Files into Folder"),
close: function() {
$dialog.data('closed', true);
@ -164,7 +163,7 @@ define([
$dialog.detach();
}, 500);
}
}).dialog('open');
});
var importFailed = function(errors) {
$dialog.text(I18n.t('errors.extracting', "There were errors extracting the zip file. Please try again."));
@ -269,11 +268,10 @@ define([
duplicatesHtml += "<span class='duplicate_filename'>" + htmlEscape(data.duplicates[idx]) + "</span>";
}
$dialog.find(".duplicate_filenames").html(duplicatesHtml);
$dialog.dialog('close').dialog({
autoOpen: false,
$dialog.dialog({
title: '',
width: 500
}).dialog('open');
});
$dialog.find("button").unbind('click');
$dialog.find(".cancel_button").click(function() {
on_cancel();
@ -1329,10 +1327,9 @@ define([
});
$("#file_uploads_dialog_link").click(function(event) {
event.preventDefault();
$("#file_uploads").dialog('close').dialog({
autoOpen: false,
$("#file_uploads").dialog({
title: I18n.t('titles.file_uplaods_queue', "File Uploads Queue")
}).dialog('open');
});
});
setTimeout(function() {
$files_structure.find(".folder > .text").droppable(files.droppable_options);
@ -1725,11 +1722,10 @@ define([
});
$("#edit_collaboration_dialog .collaborator_list").empty().append($users);
$("#edit_collaboration_dialog").dialog('close').dialog({
autoOpen: false,
$("#edit_collaboration_dialog").dialog({
title: I18n.t('titles.edit_collaboration', 'Edit Collaboration'),
width: 500
}).dialog('open');
});
});
$("#collaborations_panel .add_collaboration_link").click(function(event) {
event.preventDefault();
@ -1751,11 +1747,10 @@ define([
$(this).attr('id', $(this).attr('class'));
});
$("#edit_collaboration_dialog .collaborator_list").empty().append($users);
$("#edit_collaboration_dialog").dialog('close').dialog({
autoOpen: false,
$("#edit_collaboration_dialog").dialog({
title: I18n.t('titles.add_collaboration', 'Add New Collaboration'),
width: 500
}).dialog('open');
});
});
$("#folder_panel .download_zip").click(function(event) {
event.preventDefault();
@ -2120,12 +2115,11 @@ define([
});
$form.find("#folder_just_hide,#attachment_just_hide").attr('checked', false).change();
$form.find(".item_type").text(item_type);
$("#lock_item_dialog").dialog('close').dialog({
autoOpen: true,
$("#lock_item_dialog").dialog({
modal: true,
width: 350,
title: item_type == 'folder' ? I18n.t('titles.lock_folder', "Lock Folder") : I18n.t('titles.lock_file', 'Lock File')
}).dialog('open');
});
});
$("#folder_just_hide,#attachment_just_hide").change(function() {
$(this).parents("form").find(".full_lock").showIf(!$(this).attr('checked'));

View File

@ -429,10 +429,9 @@ define([
$assignment_details_dialog.fillTemplateData({
data: data
})
.dialog('close').dialog({
autoOpen: false,
.dialog({
title: I18n.beforeLabel('details', "Details") + " " + data.title
}).dialog('open')
})
.find(".assignment_link").attr('href', data.url);
});
}
@ -600,14 +599,13 @@ define([
if(!$box.hasClass('grading_value')) { $input = $box.find(".grading_value"); }
$input.attr('name', 'default_grade').show();
$default_grade_form.find(".grading_box_holder").empty().append($box);
$default_grade_form.dialog('close').dialog({
autoOpen: false,
$default_grade_form.dialog({
width: 350,
height: "auto",
open: function() {
$default_grade_form.find(".grading_box").focus();
}
}).dialog('open').dialog('option', 'title', I18n.t('default_grade_for_course', "Default Grade for %{assignment}", {'assignment': title}));
}).dialog('option', 'title', I18n.t('default_grade_for_course', "Default Grade for %{assignment}", {'assignment': title}));
});
if(columnData.grading_type != 'pass_fail' && columnData.points_possible) {
addOption('check', I18n.t('curve_grades', 'Curve Grades'), function() {
@ -619,15 +617,13 @@ define([
.find(".out_of").showIf(data.points_possible || data.points_possible === '0').end()
.find("#middle_score").val(parseInt((data.points_possible || 0) * 0.6, 10)).end()
.find(".points_possible").text(data.points_possible).end()
.dialog('close').dialog({
autoOpen: false,
.dialog({
width: 350,
height: "auto",
open: function() {
gradebook.curve();
}
})
.dialog('open').dialog('option', 'title', I18n.t('curve_grade_for_course', "Curve Grade for %{assignment}", {'assignment': title}));
}).dialog('option', 'title', I18n.t('curve_grade_for_course', "Curve Grade for %{assignment}", {'assignment': title}));
});
}
}
@ -647,11 +643,10 @@ define([
var url = $("#re_upload_submissions_form").find(".re_upload_submissions_url").attr('href');
url = $.replaceTags(url, "assignment_id", data.assignment_id);
$("#re_upload_submissions_form").attr('action', url);
$("#re_upload_submissions_form").dialog('close').dialog({
autoOpen: false,
$("#re_upload_submissions_form").dialog({
title: I18n.t('reupload_submission_files', "Re-Upload Submission Files"),
width: 350
}).dialog('open');
});
});
}
}
@ -1184,29 +1179,27 @@ define([
$(".sort_gradebook").each(function() {
$(this).attr('disabled', false).text($(this).attr('title'));
});
$("#sort_columns_dialog").dialog('close').dialog({
$("#sort_columns_dialog").dialog({
autoOpen: false,
width: 400,
height: 300
}).dialog('open');
});
});
addOption('carat-2-n-s', I18n.t('sort_rows_by', 'Sort Rows By...'), function() {
$(".sort_gradebook").each(function() {
$(this).attr('disabled', false).text($(this).attr('title'));
});
$("#sort_rows_dialog").dialog('close').dialog({
autoOpen: false,
$("#sort_rows_dialog").dialog({
width: 400,
height: 300
}).dialog('open');
});
});
addOption('pencil', I18n.t('set_group_weights', 'Set Group Weights'), function() {
$("#groups_data").dialog('close').dialog({
title: I18n.t('titles.assignment_groups', "Assignment Groups"),
autoOpen: false
}).dialog('open').show();
$("#groups_data").dialog({
title: I18n.t('titles.assignment_groups', "Assignment Groups")
}).show();
});
addOption('clock', I18n.t('view_grading_history', 'View Grading History'), function() {
@ -1696,7 +1689,7 @@ define([
}
$submission_information.find(".submission_comments").append($comment.show());
}
$submission_information.show().dialog('close').dialog({
$submission_information.show().dialog({
width: 500,
height: "auto",
title: title,
@ -1705,9 +1698,8 @@ define([
$("#gradebook").data('disable_highlight', true);
}, close: function() {
$("#gradebook").data('disable_highlight', false);
},
autoOpen: false
}).dialog('open').dialog('option', 'title', title);
}
}).dialog('option', 'title', title);
}
function submissionInformation($submission) {
@ -1716,10 +1708,9 @@ define([
if(submission && submission.submission_comments) {
populateSubmissionInformation($submission, submission);
} else {
$("#loading_submission_details_dialog").dialog('close').dialog({
autoOpen: false,
$("#loading_submission_details_dialog").dialog({
title: I18n.t('titles.loading', "Loading...")
}).dialog('open');
});
var url = $("#loading_submission_details_dialog .submission_details_url").attr('href');
url = $.replaceTags($.replaceTags(url, 'user_id', submission.user_id), 'assignment_id', submission.assignment_id);
// Pop up dialog with loading message

View File

@ -19,12 +19,11 @@ define([
});
$(".edit_letter_grades_link").click(function(event) {
event.preventDefault();
$("#edit_letter_grades_form").dialog('close').dialog({
$("#edit_letter_grades_form").dialog({
title: I18n.t('titles.grading_scheme_info', "View/Edit Grading Scheme"),
autoOpen: false,
width: 600,
height: 310
}).dialog('open');
});
});
$(".grading_standard .delete_grading_standard_link").click(function(event) {
event.preventDefault();

View File

@ -200,12 +200,11 @@ define([
$(document).keycodes("shift+/", function(event) {
$("#keyboard_navigation").dialog('close').dialog({
$("#keyboard_navigation").dialog({
title: I18n.t('titles.keyboard_shortcuts', "Keyboard Shortcuts"),
width: 400,
height: "auto",
autoOpen: false
}).dialog('open');
height: "auto"
});
});
$("#switched_role_type").ifExists(function(){
@ -253,12 +252,11 @@ define([
$(".custom_search_results_link").click(function(event) {
event.preventDefault();
var $dialog = $("#custom_search_results_dialog");
$dialog.dialog('close').dialog({
autoOpen: false,
$dialog.dialog({
title: I18n.t('titles.search_for_open_resources', "Search for Open Resources"),
width: 600,
height: 400
}).dialog('open');
});
var control = $dialog.data('searchControl');
if(control) {
control.execute($("title").text());
@ -571,12 +569,11 @@ define([
$(".cant_record_link").click(function(event) {
event.preventDefault();
$("#cant_record_dialog").dialog('close').dialog({
autoOpen: false,
$("#cant_record_dialog").dialog({
modal: true,
title: I18n.t('titles.cant_create_recordings', "Can't Create Recordings?"),
width: 400
}).dialog('open');
});
});
$(".communication_message .content .links .show_users_link,.communication_message .header .show_users_link").click(function(event) {

View File

@ -320,14 +320,13 @@ define([
$dialog.data('reference_url', url);
$dialog.find(".results").empty().end()
.find(".query").val("");
$dialog.dialog('close').dialog({
autoOpen: false,
$dialog.dialog({
title: I18n.t('titles.bookmark_search', "Bookmark Search: %{service_name}", {service_name: $.titleize(service_type)}),
open: function() {
$dialog.find("input:visible:first").focus().select();
},
width: 400
}).dialog('open');
});
};
$.findImageForService = function(service_type, callback) {

View File

@ -237,11 +237,10 @@ define([
$(document).ready(function() {
$("#outcome_information_link").click(function(event) {
event.preventDefault();
$("#outcome_criterion_dialog").dialog('close').dialog({
autoOpen: false,
$("#outcome_criterion_dialog").dialog({
title: I18n.t("outcome_criterion", "Learning Outcome Criterion"),
width: 400
}).dialog('open');
});
});
$(".show_details_link,.hide_details_link").click(function(event, callback) {
event.preventDefault();
@ -338,12 +337,11 @@ define([
$(".find_outcome_link").click(function(event) {
var $dialog = $("#find_outcome_dialog");
event.preventDefault();
$dialog.dialog('close').dialog({
autoOpen: true,
$dialog.dialog({
width: 600,
height: 350,
title: I18n.t("find_existing_outcome", 'Find Existing Outcome')
}).dialog('open');
});
if(!$dialog.hasClass('loaded')) {
$dialog.find(".loading_message").text(I18n.t("loading_outcomes", "Loading outcomes..."));
var url = $dialog.find(".outcomes_url").attr('href');

View File

@ -49,11 +49,10 @@ define([
$dialog.find(".existing_user").showIf(current_user_id);
$dialog
.dialog('close').dialog({
autoOpen: false,
.dialog({
title: I18n.t('titles.link_to_student', "Link to Student"),
width: 400
}).dialog('open');
});
},
updateDialog: function($dialog, enrollment_id, current_user_id) {
$dialog.find(".enrollment_id").val(enrollment_id);

View File

@ -752,11 +752,10 @@ define([
});
$(".self_signup_help_link").click(function(event) {
event.preventDefault();
$("#self_signup_help_dialog").dialog('close').dialog({
autoOpen: false,
$("#self_signup_help_dialog").dialog({
title: I18n.t('titles.self_signup_help', "Self Sign-Up Groups"),
width: 400
}).dialog('open');
});
});
contextGroups.populateCategory($("#group_tabs .group_category:first"));
$(window).resize(function() {

View File

@ -192,11 +192,10 @@ define([
$("#moderate_student_form").data('ids', student_ids);
$("#moderate_student_dialog h2").text(I18n.t('extensions_for_students', {'one': "Extensions for 1 Student", 'other': "Extensions for %{count} Students"}, {'count': student_ids.length}));
$("#moderate_student_form").fillFormData(data);
$("#moderate_student_dialog").dialog('close').dialog({
auotOpen: false,
$("#moderate_student_dialog").dialog({
title: I18n.t('titles.student_extensions', "Student Extensions"),
width: 400
}).dialog('open');
});
});
$(".moderate_student_link").live('click', function(event) {
@ -212,11 +211,10 @@ define([
$("#moderate_student_form").data('ids', [$student.attr('data-user-id')]);
$("#moderate_student_form").find("button").attr('disabled', false);
$("#moderate_student_dialog h2").text(I18n.t('extensions_for_student', "Extensions for %{student}", {'student': name}));
$("#moderate_student_dialog").dialog('close').dialog({
auotOpen: false,
$("#moderate_student_dialog").dialog({
title: I18n.t('titles.student_extensions', "Student Extensions"),
width: 400
}).dialog('open');
});
});
$(".reload_link").click(function(event) {
event.preventDefault();
@ -276,11 +274,10 @@ define([
}
});
$dialog.find("button").attr('disabled', false);
$dialog.dialog('close').dialog({
auto_open: false,
$dialog.dialog({
title: I18n.t('titles.extend_quiz_time', "Extend Quiz Time"),
width: 400
}).dialog('open');
});
});
$("#extend_time_dialog").find(".cancel_button").click(function() {
$("#extend_time_dialog").dialog('close');

View File

@ -168,10 +168,9 @@ define([
$("#unregistered_services li.service").click(function(event) {
event.preventDefault();
$("#" + $(this).attr('id') + "_dialog").dialog('close').dialog({
width: 350,
autoOpen: false
}).dialog('open');
$("#" + $(this).attr('id') + "_dialog").dialog({
width: 350
});
});
$(".create_user_service_form").formSubmit({
object_name: 'user_service',
@ -291,10 +290,9 @@ define([
event.preventDefault();
var $dialog = $("#token_details_dialog");
var url = $(this).attr('rel');
$dialog.dialog('close').dialog({
autoOpen: false,
$dialog.dialog({
width: 600
}).dialog('open');
});
var $token = $(this).parents(".access_token");
$dialog.data('token', $token);
$dialog.find(".loading_message").show().end()
@ -498,12 +496,11 @@ define([
$dialog.find(".profile_pic_list h3").text(I18n.t('errors.loading_images_failed', "Loading Images Failed, please try again"));
});
}
$("#profile_pic_dialog").dialog('close').dialog({
autoOpen: false,
$("#profile_pic_dialog").dialog({
title: I18n.t('titles.select_profile_pic', "Select Profile Pic"),
width: 500,
height: 300
}).dialog('open');
});
});
var checkImage = function() {
var img = $(".profile_pic_link img")[0];

View File

@ -51,10 +51,9 @@ $(document).ready(function() {
$list.append($quiz_item.show());
});
$dialog.find("button").attr('disabled', false);
$dialog.dialog('close').dialog({
autoOpen: false,
$dialog.dialog({
width: 400
}).dialog('open');
});
});
$("#publish_quizzes_form").submit(function() {
$(this).find("button").attr('disabled', true).filter('.submit_button').text(I18n.t('buttons.publishing_quizzes', 'Publishing Quizzes...'));

View File

@ -28,13 +28,12 @@ $(document).ready(function() {
}
function ready() {
$dialog = $("#rubrics.rubric_dialog");
$dialog.dialog('close').dialog({
$dialog.dialog({
title: I18n.t('titles.details', "Assignment Rubric Details"),
width: 600,
modal: false,
resizable: true,
autoOpen: false
}).dialog('open');
resizable: true
});
}
});
});

View File

@ -1071,11 +1071,10 @@ define([
$(".ip_filtering_link").click(function(event) {
event.preventDefault();
var $dialog = $("#ip_filters_dialog");
$dialog.dialog('close').dialog({
autoOpen: false,
$dialog.dialog({
width: 400,
title: I18n.t('titles.ip_address_filtering', "IP Address Filtering")
}).dialog('open');
});
if (!$dialog.hasClass('loaded')) {
$dialog.find(".searching_message").text(I18n.t('retrieving_filters', "Retrieving Filters..."));
var url = $("#quiz_urls .filters_url").attr('href');
@ -1563,12 +1562,11 @@ define([
}
$dialog.find(".bank.selected").removeClass('selected');
$dialog.find(".submit_button").attr('disabled', true);
$dialog.dialog('close').dialog({
autoOpen: false,
$dialog.dialog({
title: I18n.t('titles.find_question_bank', "Find Question Bank"),
width: 600,
height: 400
}).dialog('open');
});
});
$findBankDialog.delegate('.bank', 'click', function() {
@ -1622,8 +1620,7 @@ define([
});
}
$dialog.data('add_source', '');
$dialog.dialog('close').dialog({
autoOpen: false,
$dialog.dialog({
title: I18n.t('titles.find_quiz_question', "Find Quiz Question"),
open: function() {
if ($dialog.find(".selected_side_tab").length == 0) {
@ -1632,7 +1629,7 @@ define([
},
width: 600,
height: 400
}).dialog('open');
});
});
var updateFindQuestionDialogQuizGroups = function(id) {
@ -1667,10 +1664,9 @@ define([
});
$dialog.find(".questions_count").text(question_ids.length);
$dialog.find("button").attr('disabled', false).filter(".submit_button").text(I18n.t('buttons.create_group', "Create Group"));
$dialog.dialog('close').dialog({
width: 400,
autoOpen: false
}).dialog('open');
$dialog.dialog({
width: 400
});
}
});
@ -1809,10 +1805,10 @@ define([
question_ids.push($(this).parents(".found_question").data('question_data').id);
});
$dialog.find(".questions_count").text(question_ids.length);
$dialog.dialog('close').dialog({
$dialog.dialog({
autoOpen: false,
title: I18n.t('titles.add_questions_as_group', "Add Questions as a Group")
}).dialog('open');
});
}).delegate('.submit_button', 'click', function(event) {
var question_ids = [];
$findQuestionDialog.find(".question_list :checkbox:checked").each(function() {
@ -2765,11 +2761,10 @@ define([
$("#calc_helper_methods").append($option);
}
$("#calc_helper_methods").change();
$("#help_with_equations_dialog").dialog('close').dialog({
autoOpen: false,
$("#help_with_equations_dialog").dialog({
title: I18n.t('titles.help_with_formulas', "Help with Quiz Question Formulas"),
width: 500
}).dialog('open');
});
});
$question.find(".combinations_option").attr('disabled', true);
$question.find(".question_content").bind('keypress', function(event) {

View File

@ -45,11 +45,10 @@ window.rubricAssessment = {
.fillTemplateData({data: data, htmlValues: ( is_learning_outcome ? ['long_description'] : [] )})
.find(".editing").hide().end()
.find(".displaying").show().end()
.dialog('close').dialog({
autoOpen: false,
.dialog({
title: I18n.t('titles.criterion_long_description', "Criterion Long Description"),
width: 400
}).dialog('open');
});
}
})
.delegate(".criterion .saved_custom_rating", 'change', function() {
@ -75,11 +74,10 @@ window.rubricAssessment = {
$rubric_criterion_comments_dialog.fillFormData(data);
$rubric_criterion_comments_dialog.find(".editing").showIf(editing);
$rubric_criterion_comments_dialog.find(".displaying").showIf(!editing);
$rubric_criterion_comments_dialog.dialog('close').dialog({
autoOpen: false,
$rubric_criterion_comments_dialog.dialog({
title: I18n.t('titles.additional_comments', "Additional Comments"),
width: 400
}).dialog('open');
});
})
// cant use a .delegate because up above when we delegate '.rating' 'click' it calls .change() and that doesnt bubble right so it doesen't get caught
.find(".criterion_points").bind('keypress change blur', function(event) {
@ -124,11 +122,10 @@ window.rubricAssessment = {
$rubric_criterion_comments_dialog.fillFormData(data);
$rubric_criterion_comments_dialog.find(".editing").hide();
$rubric_criterion_comments_dialog.find(".displaying").show();
$rubric_criterion_comments_dialog.dialog('close').dialog({
autoOpen: false,
$rubric_criterion_comments_dialog.dialog({
title: I18n.t('titles.additional_comments', "Additional Comments"),
width: 400
}).dialog('open');
});
});

View File

@ -84,10 +84,9 @@ define([
$(".datetime_field").datetime_field();
$(".uncrosslist_link").click(function(event) {
event.preventDefault();
$("#uncrosslist_form").dialog('close').dialog({
autoOpen: false,
$("#uncrosslist_form").dialog({
width: 400
}).dialog('open');
});
});
$("#uncrosslist_form .cancel_button").click(function(event) {
$("#uncrosslist_form").dialog('close');
@ -96,10 +95,9 @@ define([
});
$(".crosslist_link").click(function(event) {
event.preventDefault();
$("#crosslist_course_form").dialog('close').dialog({
autoOpen: false,
$("#crosslist_course_form").dialog({
width: 450
}).dialog('open');
});
$("#crosslist_course_form .submit_button").attr('disabled', true);
$("#course_autocomplete_id_lookup").val("");
$("#course_id").val("").change();

View File

@ -74,11 +74,10 @@ $(document).ready(function() {
$("#select_context_content_dialog #context_module_sub_headers_select :text").val("");
$('#add_module_item_select').change();
$("#select_context_content_dialog .module_item_select").change();
$("#select_context_content_dialog").dialog('close').dialog({
autoOpen: true,
$("#select_context_content_dialog").dialog({
title: dialog_title,
width: 400
}).dialog('open');
});
$("#select_context_content_dialog").dialog('option', 'title', dialog_title);
}
$("#select_context_content_dialog .cancel_button").click(function() {

View File

@ -40,11 +40,10 @@ define([
});
});
function populateDialog(data_points, axis) {
$("#over_time_dialog").dialog('close').dialog({
autoOpen: false,
$("#over_time_dialog").dialog({
width: 630,
height: 330
}).dialog('open').dialog('option', 'title', I18n.t('titles.value_over_time', "%{value} Over Time", {value: axis}));
}).dialog('option', 'title', I18n.t('titles.value_over_time', "%{value} Over Time", {value: axis}));
var data = new google.visualization.DataTable();
data.addColumn('date', I18n.t('columns.date', 'Date'));
data.addColumn('number', axis || I18n.t('columns.value', "Value"));

View File

@ -390,11 +390,7 @@ define([
},
showSettingsModal: function(e){
this.elements.settings.form.dialog('close').dialog({
modal: true,
resizeable: false,
width: 400
}).dialog('open');
this.elements.settings.form.dialog('open');
},
onMuteClick: function(e){

View File

@ -217,15 +217,14 @@ define([
});
});
$("#submit_google_doc_form").submit(function() {
$("#uploading_google_doc_message").dialog('close').dialog({
autoOpen: false,
$("#uploading_google_doc_message").dialog({
title: I18n.t('titles.uploading', "Uploading Submission"),
modal: true,
overlay: {
backgroundColor: "#000",
opacity: 0.7
}
}).dialog('open');
});
});
$(document).ready(function() {

View File

@ -97,15 +97,14 @@ define([
});
$box.data('editor', $editor);
$box.dialog('close').dialog({
autoOpen: false,
$box.dialog({
width: 690,
minWidth: 690,
minHeight: 300,
resizable: true,
height: "auto",
title: "Embed Math Equation"
}).dialog('open');
});
// needs to be visible for some computed styles to work when we write
// the equation

View File

@ -242,15 +242,14 @@ define([
$box.find(".auto_show_inline_content").attr('checked', $a.hasClass('auto_open')).triggerHandler('change');
$box.find(".insert_button").text("Update Link");
}
$box.dialog('close').dialog({
autoOpen: false,
$box.dialog({
width: 425,
height: "auto",
title: "Link to Website URL",
open: function() {
$(this).find(".prompt").focus().select();
}
}).dialog('open');
});
});
ed.addButton('instructure_links', {
title: 'Link to URL',

View File

@ -277,25 +277,23 @@ define([
}
function ready() {
$dialog = $("#rubrics.rubric_dialog");
$dialog.dialog('close').dialog({
$dialog.dialog({
title: I18n.t('titles.assignment_rubric_details', "Assignment Rubric Details"),
width: 600,
modal: false,
resizable: true,
autoOpen: false
}).dialog('open');
resizable: true
});
}
});
$(".add_topic_rubric_link").click(function(event) {
event.preventDefault();
var $dialog = $("#rubrics.rubric_dialog");
$dialog.dialog('close').dialog({
$dialog.dialog({
title: I18n.t('titles.assignment_rubric_details', "Assignment Rubric Details"),
width: 600,
modal: false,
resizable: true,
autoOpen: false
}).dialog('open');
resizable: true
});
$(".add_rubric_link").click();
});
$("#add_entry_form .add_attachment_link").click(function(event) {

View File

@ -253,12 +253,11 @@ define([
}
$(".reorder_topics_link").click(function(event) {
event.preventDefault();
$("#reorder_topics_dialog").dialog('close').dialog({
autoOpen: false,
$("#reorder_topics_dialog").dialog({
title: I18n.t('titles.reorder_discussions', "Reorder Discussions"),
width: 400,
modal: true
}).dialog('open');
});
});
$("#topics_reorder_list").sortable({
axis: 'y'

View File

@ -97,15 +97,14 @@ $(document).ready(function() {
$form.toggleClass('passwordable', passwordable);
$form.find("tr.password").showIf(passwordable);
$form.find(".account_id").hide();
$form.dialog('close').dialog({
autoOpen: false,
$form.dialog({
width: 'auto',
close: function() {
if($form.data('unique_id_text') && $form.data('unique_id_text').parents(".login").hasClass('blank')) {
$form.data('unique_id_text').parents(".login").remove();
}
}
}).dialog('open');
});
$form.dialog('option', 'title', I18n.t('titles.update_login', 'Update Login'))
.find(".submit_button").text(I18n.t('buttons.update_login', "Update Login"));
var $unique_id = $(this).parents(".login").find(".unique_id");

View File

@ -27,10 +27,9 @@ define([
$(document).ready(function() {
$("#name_and_email").delegate('.edit_user_link', 'click', function(event) {
event.preventDefault();
$("#edit_student_dialog").dialog('close').dialog({
autoOpen: false,
$("#edit_student_dialog").dialog({
width: 450
}).dialog('open');
});
$("#edit_student_form :text:visible:first").focus().select();
});
$("#edit_student_form").formSubmit({

View File

@ -379,10 +379,9 @@ define([
$wiki_sidebar_select_folder_dialog.find(".file_count").text(filesToUpload.length);
$wiki_sidebar_select_folder_dialog.find(".folder_id").empty();
wikiSidebar.loadFolders();
$wiki_sidebar_select_folder_dialog.dialog('close').dialog({
autoOpen: false,
$wiki_sidebar_select_folder_dialog.dialog({
title: I18n.t('titles.select_folder_for_uploads', "Select folder for file uploads")
}).dialog('open');
});
return false;
}, false);
$wiki_sidebar_select_folder_dialog.find(".select_button").click(function(event) {
@ -436,10 +435,9 @@ define([
$wiki_sidebar_select_folder_dialog.find(".file_count").text(images.length);
$wiki_sidebar_select_folder_dialog.find(".folder_id").empty();
wikiSidebar.loadFolders();
$wiki_sidebar_select_folder_dialog.dialog('close').dialog({
autoOpen: false,
$wiki_sidebar_select_folder_dialog.dialog({
title: I18n.t('titles.select_folder_for_uploads', "Select folder for file uploads")
}).dialog('open');
});
return false;
}, false);
}

View File

@ -265,7 +265,7 @@ describe "admin settings tab" do
it "should click on the google help dialog" do
f("a.help").click
f("#ui-dialog-title-google_docs_previews_help_dialog").should include_text("About Google Docs Previews")
fj(".ui-dialog-title:visible").should include_text("About Google Docs Previews")
end
it "should unclick and then click on skype" do