From 747ca4357ff68cd06fd4e870439500b6e5b259a5 Mon Sep 17 00:00:00 2001 From: alekseybobkov Date: Thu, 24 Dec 2015 14:15:02 -0800 Subject: [PATCH] Set default focus in popup windows, minor style fix in the flash message, minor fix in YAML-based back-end navigation initialization. --- modules/backend/lang/en/lang.php | 5 ++++- modules/system/assets/ui/js/popup.js | 9 +++++++++ modules/system/assets/ui/less/flashmessage.less | 2 ++ modules/system/assets/ui/storm-min.js | 6 +++++- modules/system/assets/ui/storm.css | 2 +- modules/system/classes/PluginBase.php | 13 ++++++++++++- 6 files changed, 33 insertions(+), 4 deletions(-) diff --git a/modules/backend/lang/en/lang.php b/modules/backend/lang/en/lang.php index 43eb83299..1212da2b7 100644 --- a/modules/backend/lang/en/lang.php +++ b/modules/backend/lang/en/lang.php @@ -176,6 +176,8 @@ return [ 'saving_name' => 'Saving :name...', 'delete' => 'Delete', 'deleting' => 'Deleting...', + 'confirm_delete' => 'Do you really want to delete this record?', + 'confirm_delete_multiple' => 'Do you really want to delete the selected records?', 'deleting_name' => 'Deleting :name...', 'reset_default' => 'Reset to default', 'resetting' => 'Resetting', @@ -204,7 +206,8 @@ return [ 'insert_row_below' => 'Insert Row Below', 'delete_row' => 'Delete Row', 'concurrency_file_changed_title' => 'File was changed', - 'concurrency_file_changed_description' => "The file you're editing has been changed on disk by another user. You can either reload the file and lose your changes or override the file on the disk." + 'concurrency_file_changed_description' => "The file you're editing has been changed on disk by another user. You can either reload the file and lose your changes or override the file on the disk.", + 'return_to_list' => 'Return to the list' ], 'relation' => [ 'missing_config' => "Relation behavior does not have any configuration for ':config'.", diff --git a/modules/system/assets/ui/js/popup.js b/modules/system/assets/ui/js/popup.js index d77c25ceb..71ba0558d 100644 --- a/modules/system/assets/ui/js/popup.js +++ b/modules/system/assets/ui/js/popup.js @@ -181,6 +181,15 @@ this.firstDiv = this.$content.find('>div:first') if (this.firstDiv.length > 0) this.firstDiv.data('oc.popup', this) + + var $defaultFocus = $('[default-focus]', this.$content) + if ($defaultFocus.is(":visible")) + { + window.setTimeout(function() { + $defaultFocus.focus() + $defaultFocus = null + }, 300) + } } Popup.prototype.setBackdrop = function(val) { diff --git a/modules/system/assets/ui/less/flashmessage.less b/modules/system/assets/ui/less/flashmessage.less index 8028ab54e..904e11fd9 100644 --- a/modules/system/assets/ui/less/flashmessage.less +++ b/modules/system/assets/ui/less/flashmessage.less @@ -29,6 +29,8 @@ font-size: 13px; padding: 10px 30px 10px 15px; z-index: 10000; + word-wrap: break-word; + .border-radius(@border-radius-base); &.fade { diff --git a/modules/system/assets/ui/storm-min.js b/modules/system/assets/ui/storm-min.js index 44e88a4e6..2ed4634c6 100644 --- a/modules/system/assets/ui/storm-min.js +++ b/modules/system/assets/ui/storm-min.js @@ -2462,7 +2462,11 @@ this.setLoading(false) this.show() this.firstDiv=this.$content.find('>div:first') if(this.firstDiv.length>0) -this.firstDiv.data('oc.popup',this)} +this.firstDiv.data('oc.popup',this) +var $defaultFocus=$('[default-focus]',this.$content) +if($defaultFocus.is(":visible")) +{window.setTimeout(function(){$defaultFocus.focus() +$defaultFocus=null},300)}} Popup.prototype.setBackdrop=function(val){if(val&&!this.$backdrop){this.$backdrop=$('