Revision 6d7b9bc4 snf-cyclades-app/synnefo/ui/new_ui/ui/javascripts/common.js

b/snf-cyclades-app/synnefo/ui/new_ui/ui/javascripts/common.js
232 232
}
233 233

  
234 234

  
235
ui.netOptions = function(option) {
236
    var checkbox = $(option).find('.snf-checkbox-checked, .snf-checkbox-unchecked');
237
    var list = $(option).closest('ul');
235
// ui.netOptions = function(option) {
236
//     var checkbox = $(option).find('.snf-checkbox-checked, .snf-checkbox-unchecked, .snf-radio-checked, .snf-radio-unchecked');
237
//     var list = $(option).closest('ul');
238 238
    
239
    ui.checkAction(checkbox); //allazw to checkbox p pataw
240
    if(list.hasClass('subnet_options')){
241
        checkedBefore = $(option).closest('li').siblings('li').find('span.snf-checkbox-checked');
242
        if($(checkedBefore).closest('li').find('a').hasClass('manual'))
243
        {
244
            $(checkedBefore).closest('li').find('.manual_sub').hide();
245
        }
246
        ui.checkAction(checkedBefore); //allazw ta alla checkboxes
239
//     ui.checkAction(checkbox); //allazw to checkbox p pataw
240
//     if(list.hasClass('subnet_options')){
241
//         checkedBefore = $(option).closest('li').siblings('li').find('span.snf-radio-checked');
242
//         if($(checkedBefore).closest('li').find('a').hasClass('manual'))
243
//         {
244
//             $(checkedBefore).closest('li').find('.manual_sub').hide();
245
//         }
246
//         ui.checkAction(checkedBefore); //allazw ta alla checkboxes
247 247
        
248
        if($(option).hasClass('manual')) {
249

  
250
            if($(checkbox).hasClass('snf-checkbox-unchecked')) {
251
                $(option).closest('span').find('.manual_sub').hide();
252
            }
253
            else {
254
                $(option).closest('span').find('.manual_sub').show();
255
            }
256
        }
257
    }
258
    else if($(option).closest('li').hasClass('dhcp_option')) {
259
        if($(checkbox).hasClass('snf-checkbox-unchecked')) {
260
            $('.network_options').find('.subnet_options').hide();
261
        }
262
        else {
263
            $('.network_options').find('.subnet_options').show();
264
        }
265
    }
266
}
248
//         if($(option).hasClass('manual')) {
249

  
250
//             if($(checkbox).hasClass('snf-checkbox-unchecked')) {
251
//                 $(option).closest('span').find('.manual_sub').hide();
252
//             }
253
//             else {
254
//                 $(option).closest('span').find('.manual_sub').show();
255
//             }
256
//         }
257
//     }
258
//     else if($(option).closest('li').hasClass('dhcp_option')) {
259
//         if($(checkbox).hasClass('snf-checkbox-unchecked')) {
260
//             $('.network_options').find('.subnet_options').hide();
261
//             $('.network_options').find('.sub_title').hide();
262
//         }
263
//         else {
264
//             $('.network_options').find('.sub_title').show();
265
//             $('.network_options').find('.subnet_options').show();
266
//         }
267
//     }
268
// }
267 269
    
268 270
function goToByScroll(id){
269 271
      // Remove "link" from the ID
......
376 378
    // checkbox: basic reaction on click (checked, unchecked)
377 379
    $('.network_options .check').click(function(e){
378 380
        e.preventDefault();
379
        ui.netOptions(this);
381
      //  ui.netOptions(this);
380 382
    })
381 383
  
382 384
    ui.placementByUser();
......
406 408
        link.parents('div.advanced-conf-step').find('.advanced-conf-options').slideToggle();
407 409
    })
408 410

  
409
    $('#picker').farbtastic('#color');
411
    if($('#picker').length>0) { $('#picker').farbtastic('#color'); }
410 412
    $('.show-add-tag').click(function(e){
411 413
        e.preventDefault();
412 414
        $(this).parents('.tags-area').find('.snf-color-picker').slideDown();

Also available in: Unified diff