mirror of
https://github.com/ansible/awx.git
synced 2026-03-01 08:48:46 -03:30
Fixed menu bar height. After TB upgrade it was fixed at 50px. Moved back to 0 and let image height be dominant. Pulled in angular-codemirror overlay fix.
This commit is contained in:
@@ -21,47 +21,6 @@ angular.module('ParseHelper', ['Utilities', 'AngularCodeMirrorModule'])
|
|||||||
codeMirror = AngularCodeMirror();
|
codeMirror = AngularCodeMirror();
|
||||||
codeMirror.addModes($AnsibleConfig.variable_edit_modes);
|
codeMirror.addModes($AnsibleConfig.variable_edit_modes);
|
||||||
|
|
||||||
/*
|
|
||||||
scope.blockParseTypeWatch = false;
|
|
||||||
scope.blockVariableDataWatch = false;
|
|
||||||
|
|
||||||
if (scope['remove' + fld + 'Watch']) {
|
|
||||||
scope['remove' + fld + 'Watch']();
|
|
||||||
}
|
|
||||||
scope['remove' + fld + 'Watch'] = scope.$watch(pfld, function (newVal, oldVal) {
|
|
||||||
var json_obj;
|
|
||||||
if (newVal !== oldVal) {
|
|
||||||
if (newVal === 'json') {
|
|
||||||
if (scope[fld] && !/^---$/.test(scope[fld])) {
|
|
||||||
// convert YAML to JSON
|
|
||||||
try {
|
|
||||||
json_obj = jsyaml.load(scope[fld]); //parse yaml into an obj
|
|
||||||
scope[fld] = JSON.stringify(json_obj, null, " ");
|
|
||||||
} catch (err) {
|
|
||||||
// ignore parse errors. allow the user to paste values in and sync the
|
|
||||||
// radio button later. parse errors will be flagged on save.
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
scope[fld] = "{}";
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
if (scope[fld] && !/^\{\}$/.test(scope[fld])) {
|
|
||||||
// convert JSON to YAML
|
|
||||||
try {
|
|
||||||
json_obj = JSON.parse(scope[fld]);
|
|
||||||
scope[fld] = jsyaml.safeDump(json_obj);
|
|
||||||
} catch (err) {
|
|
||||||
// ignore the errors. allow the user to paste values in and sync the
|
|
||||||
// radio button later. parse errors will be flagged on save.
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
scope[fld] = "---";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
*/
|
|
||||||
|
|
||||||
scope.showCodeEditor = function() {
|
scope.showCodeEditor = function() {
|
||||||
var title = 'Edit ' + scope[pfld].toUpperCase(),
|
var title = 'Edit ' + scope[pfld].toUpperCase(),
|
||||||
container = document.getElementById('main-view');
|
container = document.getElementById('main-view');
|
||||||
|
|||||||
@@ -395,6 +395,7 @@ dd {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.navbar>.container-fluid .navbar-brand {
|
.navbar>.container-fluid .navbar-brand {
|
||||||
|
height: 0;
|
||||||
margin-left: 0;
|
margin-left: 0;
|
||||||
margin-top: 11px;
|
margin-top: 11px;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
|
|
||||||
/*********************************************
|
/*********************************************
|
||||||
* Copyright (c) 2014 AnsibleWorks, Inc.
|
* Copyright (c) 2014 AnsibleWorks, Inc.
|
||||||
*
|
*
|
||||||
@@ -24,5 +23,3 @@
|
|||||||
z-index: 2060;
|
z-index: 2060;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "angular-codemirror",
|
"name": "angular-codemirror",
|
||||||
"version": "1.0.1",
|
"version": "1.0.2",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"angular": "latest",
|
"angular": "latest",
|
||||||
"angular-route": "latest",
|
"angular-route": "latest",
|
||||||
@@ -13,11 +13,11 @@
|
|||||||
"codemirror": "latest"
|
"codemirror": "latest"
|
||||||
},
|
},
|
||||||
"homepage": "https://github.com/chouseknecht/angular-codemirror",
|
"homepage": "https://github.com/chouseknecht/angular-codemirror",
|
||||||
"_release": "1.0.1",
|
"_release": "1.0.2",
|
||||||
"_resolution": {
|
"_resolution": {
|
||||||
"type": "version",
|
"type": "version",
|
||||||
"tag": "v1.0.1",
|
"tag": "v1.0.2",
|
||||||
"commit": "9a3d595de6b18faeb0834074f73bde476e4af9ec"
|
"commit": "94b7aac548b036f4fbd94e56129ed9574e472616"
|
||||||
},
|
},
|
||||||
"_source": "git://github.com/chouseknecht/angular-codemirror.git",
|
"_source": "git://github.com/chouseknecht/angular-codemirror.git",
|
||||||
"_target": "~1.0.0",
|
"_target": "~1.0.0",
|
||||||
|
|||||||
@@ -72,13 +72,20 @@ angular.module('AngularCodeMirrorModule', [])
|
|||||||
}
|
}
|
||||||
],
|
],
|
||||||
open: function() {
|
open: function() {
|
||||||
// fix buttons- make them more twittery
|
var self = $('.ui-dialog[aria-describedby="af-code-editor-modal"]'),
|
||||||
$('.ui-dialog[aria-describedby="af-code-editor-modal"]').find('.ui-dialog-titlebar button')
|
idx, options;
|
||||||
.empty().attr({'class': 'close'}).text('x');
|
|
||||||
|
// bring the overlay up to just below the new window
|
||||||
|
idx = self.css('z-index');
|
||||||
|
$('.ui-widget-overlay').css({ 'z-index': idx - 1});
|
||||||
|
|
||||||
|
// fix buttons- make them more twittery
|
||||||
|
self.find('.ui-dialog-titlebar button').empty().attr({'class': 'close'}).text('x');
|
||||||
$('#af-code-edit-cancel').attr({ "class": "btn btn-default" }).empty().html("<i class=\"fa fa-times\"></i> Cancel");
|
$('#af-code-edit-cancel').attr({ "class": "btn btn-default" }).empty().html("<i class=\"fa fa-times\"></i> Cancel");
|
||||||
$('#af-code-edit-ok').attr({ "class": "btn btn-primary" }).empty().html("<i class=\"fa fa-check\"></i> Save");
|
$('#af-code-edit-ok').attr({ "class": "btn btn-primary" }).empty().html("<i class=\"fa fa-check\"></i> Save");
|
||||||
|
|
||||||
var options = modes[mode];
|
// initialize CodeMirror
|
||||||
|
options = modes[mode];
|
||||||
options.value = scope[model];
|
options.value = scope[model];
|
||||||
myCodeMirror = CodeMirror(document.getElementById('af-code'), options);
|
myCodeMirror = CodeMirror(document.getElementById('af-code'), options);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user