@ -42,19 +42,7 @@ function DispositivoEdit() {
$ . get ( url , form_data ) . done ( function ( data ) {
$ . get ( url , form_data ) . done ( function ( data ) {
instance . clearEditSelected ( ) ;
instance . clearEditSelected ( ) ;
if ( data . pk != null ) {
if ( data . pk != null ) {
if ( data . message !== undefined ) {
instance . message ( data ) ;
if ( data . message . modal ) {
instance . modalMessage ( data . message . value , 'alert-' + data . message . type , function ( ) {
instance . waitShow ( ) ;
instance . refreshScreenFocusPk ( data ) ;
} ) ;
return ;
}
else {
instance . message ( data )
}
}
instance . refreshScreenFocusPk ( data ) ;
}
}
} ) . fail ( instance . waitHide ) . always ( instance . waitHide ) ;
} ) . fail ( instance . waitHide ) . always ( instance . waitHide ) ;
}
}
@ -275,6 +263,16 @@ function DispositivoEdit() {
}
}
instance . message = function ( data ) {
instance . message = function ( data ) {
if ( data . message !== undefined ) {
if ( data . message . modal ) {
instance . modalMessage ( data . message . value , 'alert-' + data . message . type , function ( ) {
instance . waitShow ( ) ;
instance . refreshScreenFocusPk ( data ) ;
} ) ;
return ;
}
else {
instance . refreshScreenFocusPk ( data ) ;
if ( ! ( 'message' in data ) )
if ( ! ( 'message' in data ) )
return ;
return ;
var cp_notify = $ ( ".cp-notify" )
var cp_notify = $ ( ".cp-notify" )
@ -286,6 +284,11 @@ function DispositivoEdit() {
cp_notify . addClass ( 'hide' ) ;
cp_notify . addClass ( 'hide' ) ;
} , ( data . message . time ? data . message . time : 3000 ) ) ;
} , ( data . message . time ? data . message . time : 3000 ) ) ;
}
}
}
else {
instance . refreshScreenFocusPk ( data ) ;
}
}
instance . offClicks = function ( ) {
instance . offClicks = function ( ) {
$ ( '.btn-dpt-edit' ) . off ( )
$ ( '.btn-dpt-edit' ) . off ( )
}
}
@ -315,7 +318,6 @@ function DispositivoEdit() {
instance . clearEditSelected ( ) ;
instance . clearEditSelected ( ) ;
if ( data . pk != null ) {
if ( data . pk != null ) {
instance . refreshScreenFocusPk ( data ) ;
instance . message ( data ) ;
instance . message ( data ) ;
}
}
else {
else {
@ -346,7 +348,6 @@ function DispositivoEdit() {
instance . clearEditSelected ( ) ;
instance . clearEditSelected ( ) ;
if ( data . pk != null ) {
if ( data . pk != null ) {
instance . refreshScreenFocusPk ( data ) ;
instance . message ( data ) ;
instance . message ( data ) ;
}
}
else {
else {
@ -377,7 +378,6 @@ function DispositivoEdit() {
instance . clearEditSelected ( ) ;
instance . clearEditSelected ( ) ;
if ( data . pk != null ) {
if ( data . pk != null ) {
instance . refreshScreenFocusPk ( data ) ;
instance . message ( data ) ;
instance . message ( data ) ;
}
}
else {
else {
@ -437,7 +437,6 @@ function DispositivoEdit() {
instance . clearEditSelected ( ) ;
instance . clearEditSelected ( ) ;
if ( data . pk != null ) {
if ( data . pk != null ) {
instance . refreshScreenFocusPk ( data ) ;
instance . message ( data ) ;
instance . message ( data ) ;
}
}
else {
else {