Sending focus to modal in CMS

This commit is contained in:
Chris Rodriguez
2015-07-24 16:07:34 -04:00
parent dccc36a452
commit 2bea68fc58
5 changed files with 30 additions and 9 deletions

View File

@@ -3,8 +3,8 @@
*/
define(["jquery", "common/js/spec_helpers/template_helpers", "js/spec_helpers/view_helpers"],
function($, TemplateHelpers, ViewHelpers) {
var installModalTemplates, getModalElement, getModalTitle, isShowingModal, hideModalIfShowing,
pressModalButton, cancelModal, cancelModalIfShowing;
var installModalTemplates, getModalElement, getModalWindow, getModalTitle, isShowingModal,
hideModalIfShowing, pressModalButton, cancelModal, cancelModalIfShowing;
installModalTemplates = function(append) {
ViewHelpers.installViewTemplates(append);
@@ -22,6 +22,11 @@ define(["jquery", "common/js/spec_helpers/template_helpers", "js/spec_helpers/vi
return modalElement;
};
getModalWindow = function(modal) {
var modalElement = getModalElement(modal);
return modalElement.find('.modal-window');
};
getModalTitle = function(modal) {
var modalElement = getModalElement(modal);
return modalElement.find('.modal-window-title').text();
@@ -58,6 +63,7 @@ define(["jquery", "common/js/spec_helpers/template_helpers", "js/spec_helpers/vi
return $.extend(ViewHelpers, {
'getModalElement': getModalElement,
'getModalWindow': getModalWindow,
'getModalTitle': getModalTitle,
'installModalTemplates': installModalTemplates,
'isShowingModal': isShowingModal,