Skip to content

Commit

Permalink
path fix
Browse files Browse the repository at this point in the history
  • Loading branch information
theDyingMountain committed Apr 11, 2016
1 parent de91914 commit eb06b6a
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
7 changes: 3 additions & 4 deletions assets/js/comparison_slider.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
(function($) {
var comparisonSliderWidth;
var comparisonSliderRatio;
var comparisonSliderClicked;
var comparisonSliderPositionX;
var mousePositionX;

function initComparisonSlider() {

var comparisonSliderClicked = false;

if ($(".comparison-slider").length > 0) {
$('.comparison-slider').each(function() {
console.log("test");
comparisonSliderWidth = $(this).width();
$(this).find(".ce_image").each(function() {
// var srcToBackground = $(this).find("img").attr("src");
Expand Down Expand Up @@ -64,5 +63,5 @@
initComparisonSlider();
});

})(jQuery);


4 changes: 2 additions & 2 deletions elements/ContentComparisonSlider.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ protected function compile() {
$pictureLeft = \FilesModel::findByUuid($this->pictureLeftSRC);
$pictureRight = \FilesModel::findByUuid($this->pictureRightSRC);


list($width, $height) = getimagesize($pictureLeft->path);
// echo $_SERVER["DOCUMENT_ROOT"].$pictureLeft->path;
list($width, $height) = getimagesize($_SERVER["DOCUMENT_ROOT"].$pictureLeft->path);

$this->Template->pictureWidth = $width;
$this->Template->pictureHeight = $height;
Expand Down
1 change: 1 addition & 0 deletions templates/ce_comparison_slider.html5
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@

<div class="<?= $this->classNames ?>">
<div class="ce_image" img-width="<?= $this->pictureWidth ?>" img-height="<?= $this->pictureHeight ?>" style="<?= $this->pictureLeftPath ?>">
<div class="comparison-slider-text comparison-slider-text-left" style="<?= $this->textLeftPosition; ?>"><?= $this->textLeft; ?></div>
Expand Down

0 comments on commit eb06b6a

Please sign in to comment.