From 59184fa6a94a7a8da034dc0271d9b85f58092d0f Mon Sep 17 00:00:00 2001 From: Dan Brown Date: Thu, 13 Aug 2015 07:44:10 +0100 Subject: [PATCH] Started on hiding manager on request --- resources/assets/js/image-manager.js | 39 +++++++++++++++++++++--- resources/assets/sass/image-manager.scss | 8 ++++- resources/views/home.blade.php | 9 ++++++ 3 files changed, 50 insertions(+), 6 deletions(-) diff --git a/resources/assets/js/image-manager.js b/resources/assets/js/image-manager.js index 2aaf02909..97c7f5a0a 100644 --- a/resources/assets/js/image-manager.js +++ b/resources/assets/js/image-manager.js @@ -18,7 +18,8 @@ this.callback = callback; } - hide() { + hide(e) { + console.log('test'); $(React.findDOMNode(this)).hide(); } @@ -72,8 +73,9 @@ render() { var loadMore = this.loadMore.bind(this); var selectImage = this.selectImage.bind(this); + var hide = this.hide.bind(this); return ( -
+
@@ -82,6 +84,7 @@
+

Images

@@ -90,7 +93,6 @@ } } - window.ImageManager = new ImageManager(); class ImageList extends React.Component { @@ -113,21 +115,48 @@ class Image extends React.Component { + constructor(){ + super(); + this._dblClickTime = 160; + this._cClickTime = 0; + } + setImage() { this.props.selectImage(this.props.image); } + imageClick() { + var cTime = (new Date()).getTime(); + var timeDiff = cTime - this._cClickTime; + console.log(timeDiff); + if(this._cClickTime !== 0 && timeDiff < this._dblClickTime) { + // DoubleClick + this.setImage(); + } else { + // Single Click + } + this._cClickTime = cTime; + } + render() { - var setImage = this.setImage.bind(this); + var imageClick = this.imageClick.bind(this); return (
- +
); } } + class ImageInfoPage extends React.Component { + + render() { + + } + + } + if(document.getElementById('image-manager-container')) { window.ImageManager = React.render( , diff --git a/resources/assets/sass/image-manager.scss b/resources/assets/sass/image-manager.scss index ffcad943f..d0ae6ded4 100644 --- a/resources/assets/sass/image-manager.scss +++ b/resources/assets/sass/image-manager.scss @@ -53,7 +53,13 @@ padding: 0 $-l; border-left: 1px solid #DDD; } - +.image-manager-close { + position: absolute; + top: 0; + right: 0; + margin: 0; + border-radius: 0; +} .image-manager-list { overflow-y: scroll; flex: 1; diff --git a/resources/views/home.blade.php b/resources/views/home.blade.php index e158087fc..8466c6d88 100644 --- a/resources/views/home.blade.php +++ b/resources/views/home.blade.php @@ -2,4 +2,13 @@ @section('content')
+@stop + + +@section('bottom') +
+ + @stop \ No newline at end of file