Proyectos de Subversion LeadersLinked - Backend

Rev

Rev 8467 | Rev 8473 | Ir a la última revisión | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 8467 Rev 8469
Línea 182... Línea 182...
182
        e.preventDefault();
182
        e.preventDefault();
Línea 183... Línea 183...
183
        
183
        
184
        $("#extended-box").modal('hide');
184
        $("#extended-box").modal('hide');
185
        return false;
185
        return false;
186
    });
-
 
187
 
-
 
188
	var validatorIndustry = $('#form-industry').validate({
-
 
189
        debug: true,
-
 
190
        onclick: false,
-
 
191
        onkeyup: false,
-
 
192
        onfocusout: false,
-
 
193
        ignore: [],
-
 
194
        rules: {
-
 
195
            'industry_id': {
-
 
196
                required: true,
-
 
197
            },
-
 
198
        },
-
 
199
 
-
 
200
        submitHandler: function(form)
-
 
201
        {
-
 
202
            NProgress.start();
-
 
203
            $.ajax({
-
 
204
                'dataType'  : 'json',
-
 
205
                'accept'    : 'application/json',
-
 
206
                'method'    : 'post',
-
 
207
                'url'       :  $('#form-industry').attr('action'),
-
 
208
                'data'      :  $('#form-industry').serialize()
-
 
209
            }).done(function(response) {
-
 
210
                if(response['success']) {
-
 
211
 
-
 
212
                    $('#overview-industry').html(response['data']);
-
 
213
                    $("#industry-box").modal('hide');
-
 
214
                } else {
-
 
215
                    validatorIndustry.resetForm();
-
 
216
                    if(jQuery.type(response['data']) == 'string') {
-
 
217
                        $.fn.showError(response['data']);
-
 
218
                    } else  {
-
 
219
                        $.each(response['data'], function( fieldname, errors ) {
-
 
220
                            $.fn.showFormErrorValidator('#form-industry #' + fieldname, errors);
-
 
221
                        });
-
 
222
                    }
-
 
223
                }
-
 
224
            }).fail(function( jqXHR, textStatus, errorThrown) {
-
 
225
                $.fn.showError(textStatus);
-
 
226
            }).always(function() {
-
 
227
                NProgress.done();
-
 
228
            });
-
 
229
            return false;
-
 
230
        },
-
 
231
        invalidHandler: function(form, validator) {
-
 
232
        
-
 
233
        }
-
 
234
    });
-
 
235
 
-
 
236
 
-
 
237
    $('.btn-industry-edit').on("click", function(e){
-
 
238
        e.preventDefault();
-
 
239
 
-
 
240
        NProgress.start();
-
 
241
        $.ajax({
-
 
242
            'dataType'  : 'json',
-
 
243
            'accept'    : 'application/json',
-
 
244
            'method'    : 'get',
-
 
245
            'url'       : '$routeIndustry',
-
 
246
        }).done(function(response) {
-
 
247
           if(response['success']) {
-
 
248
				$('#form-industry #industry_id').val(response['data']['industry_id']).trigger('change');
-
 
249
           
-
 
250
                validatorIndustry.resetForm();
-
 
251
 
-
 
252
                $("#industry-box").modal('show');
-
 
253
            } else {
-
 
254
                $.fn.showError(response['data']);
-
 
255
            }
-
 
256
        }).fail(function( jqXHR, textStatus, errorThrown) {
-
 
257
            $.fn.showError(textStatus);
-
 
258
        }).always(function() {
-
 
259
            NProgress.done();
-
 
260
        });
-
 
261
        return false;
-
 
262
 
-
 
263
    });
-
 
264
    
-
 
265
    $('.btn-industry-close').on("click", function(e){
-
 
266
        e.preventDefault();
-
 
267
        
-
 
268
        $("#industry-box").modal('hide');
-
 
269
        return false;
-
 
Línea 270... Línea 186...
270
    });    
186
    });
Línea 271... Línea 187...
271
    
187