Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Easy Admin CSS not Loading on browser view #39

Open
wants to merge 1 commit into
base: 2.x
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
87 changes: 48 additions & 39 deletions src/Resources/views/browser.html.twig
Original file line number Diff line number Diff line change
@@ -1,40 +1,49 @@
{% extends '@!EasyAdmin/page/login_minimal.html.twig' %}

{% trans_default_domain 'EasyMediaBundle' %}
<!DOCTYPE html>
<html lang="{{ langCode }}">
<head>
<meta charset="utf-8">
<title>{{ 'title'|trans|striptags|raw }}</title>
<link rel="stylesheet" href="{{ asset('bundles/easyadmin/app.css') }}"/>
<link rel="stylesheet" href="{{ asset('bundles/easymedia/style/style.css') }}"/>
</head>
<body>
<div id="media-holder" class="fullscreen">
{% include '@EasyMedia/manager.html.twig' with {'browser': true, 'modal': true, "restrict": restrict, 'hideExt' : ["jpeg"]} %}
</div>
<script src="{{ asset('bundles/easymedia/js/app.js') }}"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/camanjs/4.1.2/caman.full.min.js"></script>
<style>
html, body, #media-holder{
overflow: hidden;
height: 100%;
}
</style>
<script>
window.addEventListener("load", function(event) {
window.EventHub.listen('file_selected_datas', (datas) => {
var funcNum = '{{ CKEditorFuncNum }}';
var fileUrl = datas.path;
var alt = datas.metas.alt ? datas.metas.alt : null;
window.opener.CKEDITOR.tools.callFunction( funcNum, fileUrl, function() {
var dialog = this.getDialog();
if ( dialog.getName() == 'image' ) {
var element = dialog.getContentElement( 'info', 'txtAlt' );
if ( element && alt)
element.setValue( alt );
}
} );
})
});
</script>
</body>
</html>

{% block page_title %}{{ 'title'|trans|striptags|raw }}{% endblock %}

{% block wrapper_wrapper %}
<div id="media-holder" class="fullscreen">
{% include '@EasyMedia/manager.html.twig' with {'browser': true, 'modal': true, "restrict": restrict, 'hideExt' : ["jpeg"]} %}
</div>
{% endblock %}

{% block body_class %}{{- parent() -}} ea-content-width-full easy-media-admin{% endblock %}

{# styles #}
{% block head_stylesheets %}
{{ parent() }}
<link rel="stylesheet" href="{{ asset('bundles/easymedia/style/style.css') }}"/>
<style>
html, body, #media-holder{
overflow: hidden;
height: 100%;
}
</style>
{% endblock %}

{# scripts #}
{% block head_javascript %}
{{ parent() }}
<script src="{{ asset('bundles/easymedia/js/app.js') }}"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/camanjs/4.1.2/caman.full.min.js"></script>
<script>
window.addEventListener("load", function(event) {
window.EventHub.listen('file_selected_datas', (datas) => {
var funcNum = '{{ CKEditorFuncNum }}';
var fileUrl = datas.path;
var alt = datas.metas.alt ? datas.metas.alt : null;
window.opener.CKEDITOR.tools.callFunction( funcNum, fileUrl, function() {
var dialog = this.getDialog();
if ( dialog.getName() == 'image' ) {
var element = dialog.getContentElement( 'info', 'txtAlt' );
if ( element && alt)
element.setValue( alt );
}
} );
})
});
</script>
{% endblock %}