Set default focus in popup windows, minor style fix in the flash message, minor fix in YAML-based back-end navigation initialization.

This commit is contained in:
alekseybobkov 2015-12-24 14:15:02 -08:00
parent e6d93cf3d4
commit 747ca4357f
6 changed files with 33 additions and 4 deletions

View File

@ -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'.",

View File

@ -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) {

View File

@ -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 {

View File

@ -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=$('<div class="popup-backdrop fade" />')
if(this.options.zIndex!==null)
this.$backdrop.css('z-index',this.options.zIndex)

View File

@ -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}

View File

@ -4,6 +4,7 @@ use Illuminate\Support\ServiceProvider as ServiceProviderBase;
use ReflectionClass;
use SystemException;
use Yaml;
use Backend;
/**
* Plugin base class
@ -101,7 +102,17 @@ class PluginBase extends ServiceProviderBase
{
$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;
}
}