File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 536536 } ,
537537 networkDomain : {
538538 label : 'label.network.domain'
539+ } ,
540+ domain : {
541+ label : 'label.domain' ,
542+ select : function ( args ) {
543+ var items = [ ] ;
544+ $ . ajax ( {
545+ url : createURL ( "listDomains&listAll=true" ) ,
546+ dataType : "json" ,
547+ async : false ,
548+ success : function ( json ) {
549+ var items = [ ] ;
550+ items . push ( {
551+ id : "" ,
552+ description : ""
553+ } ) ;
554+ var domainObjs = json . listdomainsresponse . domain ;
555+ $ ( domainObjs ) . each ( function ( ) {
556+ items . push ( {
557+ id : this . id ,
558+ description : this . path
559+ } ) ;
560+ } ) ;
561+ args . response . success ( {
562+ data : items
563+ } ) ;
564+ }
565+ } ) ;
566+ args . $select . change ( function ( ) {
567+ var $form = $ ( this ) . closest ( 'form' ) ;
568+ if ( $ ( this ) . val ( ) == "" ) {
569+ $form . find ( '.form-item[rel=account]' ) . hide ( ) ;
570+ } else {
571+ $form . find ( '.form-item[rel=account]' ) . css ( 'display' , 'inline-block' ) ;
572+ }
573+ } ) ;
574+ } ,
575+ } ,
576+ account : {
577+ label : 'label.account' ,
578+ validation : {
579+ required : true
580+ } ,
539581 }
540582 }
541583 } ,
575617 } ) ;
576618 }
577619
620+ if ( args . $form . find ( '.form-item[rel=domain]' ) . css ( "display" ) != "none" ) {
621+ if ( args . data . domain != null && args . data . domain . length > 0 ) {
622+ $ . extend ( dataObj , {
623+ domainid : args . data . domain
624+ } ) ;
625+ }
626+ if ( args . data . account != null && args . data . account . length > 0 ) {
627+ $ . extend ( dataObj , {
628+ account : args . data . account
629+ } ) ;
630+ }
631+ }
632+
578633 $ . ajax ( {
579634 url : createURL ( 'createNetwork' ) ,
580635 data : dataObj ,
You can’t perform that action at this time.
0 commit comments