Skip to content

Commit

Permalink
Set default focus in popup windows, minor style fix in the flash mess…
Browse files Browse the repository at this point in the history
…age, minor fix in YAML-based back-end navigation initialization.
  • Loading branch information
alekseybobkov committed Dec 24, 2015
1 parent e6d93cf commit 747ca43
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 4 deletions.
5 changes: 4 additions & 1 deletion modules/backend/lang/en/lang.php
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,8 @@
'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',
Expand Down Expand Up @@ -204,7 +206,8 @@
'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'.",
Expand Down
9 changes: 9 additions & 0 deletions modules/system/assets/ui/js/popup.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
2 changes: 2 additions & 0 deletions modules/system/assets/ui/less/flashmessage.less
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
6 changes: 5 additions & 1 deletion modules/system/assets/ui/storm-min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion modules/system/assets/ui/storm.css
Original file line number Diff line number Diff line change
Expand Up @@ -1571,7 +1571,7 @@ div.scoreboard .control-chart .canvas + ul{margin-left:0}
div.scoreboard .scoreboard-offset{padding-left:20px}
body.slim-container div.scoreboard{padding:0 20px}
#layout-canvas .flash-message{display:none}
.flash-message{position:fixed;width:500px;left:50%;top:13px;margin-left:-250px;color:#ffffff;font-size:13px;padding:10px 30px 10px 15px;z-index:10000;-webkit-border-radius:2px;-moz-border-radius:2px;border-radius:2px}
.flash-message{position:fixed;width:500px;left:50%;top:13px;margin-left:-250px;color:#ffffff;font-size:13px;padding:10px 30px 10px 15px;z-index:10000;word-wrap:break-word;-webkit-border-radius:2px;-moz-border-radius:2px;border-radius:2px}
.flash-message.fade{opacity:0;filter:alpha(opacity=0);-webkit-transition:all 0.5s,width 0s;transition:all 0.5s,width 0s;-webkit-transform:scale(0.9);-ms-transform:scale(0.9);transform:scale(0.9)}
.flash-message.fade.in{opacity:1;filter:alpha(opacity=100);-webkit-transform:scale(1);-ms-transform:scale(1);transform:scale(1)}
.flash-message.success{background:#8da85e}
Expand Down
13 changes: 12 additions & 1 deletion modules/system/classes/PluginBase.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
use ReflectionClass;
use SystemException;
use Yaml;
use Backend;

/**
* Plugin base class
Expand Down Expand Up @@ -101,7 +102,17 @@ public function registerNavigation()
{
$configuration = $this->getConfigurationFromYaml();
if (array_key_exists('navigation', $configuration)) {
return $configuration['navigation'];
$navigation = $configuration['navigation'];

if (is_array($navigation)) {
array_walk_recursive($navigation, function(&$item, $key){
if ($key == 'url') {
$item = Backend::url($item);
}
});
}

return $navigation;
}
}

Expand Down

0 comments on commit 747ca43

Please sign in to comment.