File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed
resources/views/components/attribute/widget Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -86,6 +86,9 @@ function process_oc() {
8686 success : function (data ) {
8787 // Render any must attributes
8888 if (data .must .length ) {
89+ var newattr = $ (' select#rdn' );
90+ var oldoptions = $ (' select#rdn option' ).map ((i ,o )=> o .value ).get ();
91+
8992 data .must .forEach (function (item ) {
9093 if ($ (' attribute#' + item .toLowerCase ()).length )
9194 return ;
@@ -107,6 +110,21 @@ function process_oc() {
107110 alert (' That didnt work? Please try again....' );
108111 },
109112 });
113+
114+ // If this is a new entry, add the required attributes to the RDN
115+ if (! oldoptions .includes (item))
116+ newattr .append (new Option (item,item,false ,false ));
117+
118+ // Sort the attributes
119+ newattr
120+ .append ($ (' select#rdn option' )
121+ .remove ()
122+ .sort (function (a ,b ) {
123+ let at = $ (a).text (),
124+ bt = $ (b).text ();
125+ return (at > bt) ? 1 : ((at < bt) ? - 1 : 0 );
126+ }))
127+ .val (' ' );
110128 })
111129 }
112130
You can’t perform that action at this time.
0 commit comments