-
Notifications
You must be signed in to change notification settings - Fork 63
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixing tooltip on bootstrap3. Attempting to fix modal
- Loading branch information
Showing
2 changed files
with
94 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
<?php | ||
/** | ||
* @package Redcore | ||
* @subpackage Layouts | ||
* | ||
* @copyright Copyright (C) 2008 - 2016 redCOMPONENT.com. All rights reserved. | ||
* @license GNU General Public License version 2 or later, see LICENSE. | ||
*/ | ||
|
||
defined('JPATH_REDCORE') or die; | ||
|
||
$modal = $displayData; | ||
|
||
$doc = JFactory::getDocument(); | ||
|
||
$cssId = $modal->getAttribute('id'); | ||
|
||
if ($link = $modal->params->get('link', null)) | ||
{ | ||
// @ToDo Remove re adding css style if more modal buttons are used | ||
$styleSheet = " | ||
iframe { border: 0 none; } | ||
.modal { | ||
position: absolute; | ||
left: 40%; | ||
} | ||
.modal-body { | ||
padding: 5px; | ||
} | ||
"; | ||
$doc->addStyleDeclaration($styleSheet); | ||
|
||
$jsEvents = $modal->params->get('events', array()); | ||
$jsEventsString = ''; | ||
|
||
foreach ($jsEvents as $event => $function) | ||
{ | ||
$jsEventsString .= $event . '="' . $function . '(this)" '; | ||
} | ||
|
||
$script = array(); | ||
|
||
$script[] = ' (function($) {'; | ||
$script[] = ' $(document).ready(function() {'; | ||
$script[] = ' $(\'#' . $cssId . '\').on(\'show\', function () {'; | ||
$script[] = ' $(\'#' . $cssId . ' .modal-body\').html(\'<iframe class="iframe" src="' . $link . '" width="' . | ||
$modal->params->get('width', '100%') . '" scrolling="no" ' . $jsEventsString . '"></iframe>\');'; | ||
$script[] = ' });'; | ||
$script[] = ' });'; | ||
$script[] = ' })( jQuery );'; | ||
|
||
$doc->addScriptDeclaration(implode("\n", $script)); | ||
} | ||
|
||
?> | ||
<!-- Modal --> | ||
<div <?php echo $modal->renderAttributes(); ?>> | ||
<div class="modal-dialog"> | ||
<div class="modal-content"> | ||
<?php if ($modal->params->get('showHeader', true)) : ?> | ||
<?php echo $this->sublayout('header', $modal); ?> | ||
<?php endif; ?> | ||
<?php echo $this->sublayout('body', $modal); ?> | ||
<?php if ($modal->params->get('showFooter', true)) : ?> | ||
<?php echo $this->sublayout('footer', $modal); ?> | ||
<?php endif; ?> | ||
</div> | ||
</div> | ||
</div> |