Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Catch the user press Esc key for quit fullscreen case
  • Loading branch information
johnitvn committed Jul 3, 2015
1 parent d6cc968 commit 1d96901
Show file tree
Hide file tree
Showing 5 changed files with 145 additions and 19 deletions.
3 changes: 3 additions & 0 deletions CrudAsset.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,11 @@ class CrudAsset extends AssetBundle
public $css = [
];
public $js = [
//'jquery.fullscreen.js',
//'ajaxcrud.js',
'jquery.fullscreen.min.js',
'ajaxcrud.min.js',

];
public $depends = [
'yii\web\YiiAsset',
Expand Down
31 changes: 17 additions & 14 deletions assets/ajaxcrud.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
* Ajax Crud
* =================================
* Use for johnitvn/yii2-ajaxcrud extension
* @author John Martin [email protected]
*/

(function( $ ) {
Expand Down Expand Up @@ -237,22 +238,22 @@
return false;
}


function onToggleFullscreenAction(){
if($(this).find("i").hasClass('glyphicon-resize-full')){
launchIntoFullscreen(document.getElementById(dataTablePjaxId.substring(1))); // the whole page
$(this).find("i").removeClass('glyphicon-resize-full');
$(this).find("i").addClass('glyphicon-resize-small');
$(createActionButtonCls).addClass("hidden");
}else{
exitFullscreen();
$(this).find("i").removeClass('glyphicon-resize-small');
$(this).find("i").addClass('glyphicon-resize-full');
$(createActionButtonCls).removeClass("hidden");
}

$(window).data('fullscreen-state')?exitFullscreen():launchIntoFullscreen(document.getElementById(dataTablePjaxId.substring(1)));
}


$(window).bind("fullscreen-on", function(e) {
$(toggleFullscreenActionButtonCls).find("i").removeClass('glyphicon-resize-full');
$(toggleFullscreenActionButtonCls).find("i").addClass('glyphicon-resize-small');
});

$(window).bind("fullscreen-off", function(e) {
$(toggleFullscreenActionButtonCls).find("i").removeClass('glyphicon-resize-small');
$(toggleFullscreenActionButtonCls).find("i").addClass('glyphicon-resize-full');
});


function onUpdatePositiveClick(e){
var form = $(modalId).find('form');
$.ajax({
Expand Down Expand Up @@ -342,8 +343,10 @@
$(modalId).on('hidden.bs.modal',clearModalData);




}( jQuery ));


}( jQuery ));


6 changes: 1 addition & 5 deletions assets/ajaxcrud.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 1d96901

Please sign in to comment.