@@ -5,6 +5,16 @@ $.fn.editable.defaults.params = function (params) {
55 return params ;
66} ;
77
8+ $ . fn . editable . defaults . error = function ( data ) {
9+ var msg = '' ;
10+ if ( data . responseJSON . errors ) {
11+ $ . each ( data . responseJSON . errors , function ( k , v ) {
12+ msg += v + '\\n' ;
13+ } ) ;
14+ }
15+ return msg
16+ } ;
17+
818toastr . options = {
919 closeButton : true ,
1020 progressBar : true ,
@@ -18,45 +28,47 @@ $(document).pjax('a:not(a[target="_blank"])', {
1828 container : '#pjax-container'
1929} ) ;
2030
21- NProgress . configure ( { parent : '#pjax-container' } ) ;
31+ NProgress . configure ( { parent : '#pjax-container' } ) ;
2232
23- $ ( document ) . on ( 'pjax:timeout' , function ( event ) { event . preventDefault ( ) ; } )
33+ $ ( document ) . on ( 'pjax:timeout' , function ( event ) {
34+ event . preventDefault ( ) ;
35+ } )
2436
25- $ ( document ) . on ( 'submit' , 'form[pjax-container]' , function ( event ) {
37+ $ ( document ) . on ( 'submit' , 'form[pjax-container]' , function ( event ) {
2638 $ . pjax . submit ( event , '#pjax-container' )
2739} ) ;
2840
29- $ ( document ) . on ( "pjax:popstate" , function ( ) {
41+ $ ( document ) . on ( "pjax:popstate" , function ( ) {
3042
31- $ ( document ) . one ( "pjax:end" , function ( event ) {
32- $ ( event . target ) . find ( "script[data-exec-on-popstate]" ) . each ( function ( ) {
43+ $ ( document ) . one ( "pjax:end" , function ( event ) {
44+ $ ( event . target ) . find ( "script[data-exec-on-popstate]" ) . each ( function ( ) {
3345 $ . globalEval ( this . text || this . textContent || this . innerHTML || '' ) ;
3446 } ) ;
3547 } ) ;
3648} ) ;
3749
38- $ ( document ) . on ( 'pjax:send' , function ( xhr ) {
39- if ( xhr . relatedTarget && xhr . relatedTarget . tagName && xhr . relatedTarget . tagName . toLowerCase ( ) === 'form' ) {
50+ $ ( document ) . on ( 'pjax:send' , function ( xhr ) {
51+ if ( xhr . relatedTarget && xhr . relatedTarget . tagName && xhr . relatedTarget . tagName . toLowerCase ( ) === 'form' ) {
4052 $submit_btn = $ ( 'form[pjax-container] :submit' ) ;
41- if ( $submit_btn ) {
53+ if ( $submit_btn ) {
4254 $submit_btn . button ( 'loading' )
4355 }
4456 }
4557 NProgress . start ( ) ;
4658} ) ;
4759
48- $ ( document ) . on ( 'pjax:complete' , function ( xhr ) {
49- if ( xhr . relatedTarget && xhr . relatedTarget . tagName && xhr . relatedTarget . tagName . toLowerCase ( ) === 'form' ) {
60+ $ ( document ) . on ( 'pjax:complete' , function ( xhr ) {
61+ if ( xhr . relatedTarget && xhr . relatedTarget . tagName && xhr . relatedTarget . tagName . toLowerCase ( ) === 'form' ) {
5062 $submit_btn = $ ( 'form[pjax-container] :submit' ) ;
51- if ( $submit_btn ) {
63+ if ( $submit_btn ) {
5264 $submit_btn . button ( 'reset' )
5365 }
5466 }
5567 NProgress . done ( ) ;
5668} ) ;
5769
58- $ ( function ( ) {
59- $ ( '.sidebar-menu li:not(.treeview) > a' ) . on ( 'click' , function ( ) {
70+ $ ( function ( ) {
71+ $ ( '.sidebar-menu li:not(.treeview) > a' ) . on ( 'click' , function ( ) {
6072 var $parent = $ ( this ) . parent ( ) . addClass ( 'active' ) ;
6173 $parent . siblings ( '.treeview.active' ) . find ( '> a' ) . trigger ( 'click' ) ;
6274 $parent . siblings ( ) . removeClass ( 'active' ) . find ( 'li' ) . removeClass ( 'active' ) ;
@@ -65,7 +77,7 @@ $(function(){
6577 $ ( '[data-toggle="popover"]' ) . popover ( ) ;
6678} ) ;
6779
68- ( function ( $ ) {
80+ ( function ( $ ) {
6981 $ . fn . admin = LA ;
7082 $ . admin = LA ;
7183
0 commit comments