Skip to content
This repository was archived by the owner on Jan 23, 2025. It is now read-only.

Commit a758045

Browse files
deedeeskyhit
authored andcommitted
restore delete button for group (#330)
1 parent c0c5164 commit a758045

File tree

2 files changed

+8
-9
lines changed

2 files changed

+8
-9
lines changed

src/web/scripts/launch/contestDetailSoftware.js

+5-1
Original file line numberDiff line numberDiff line change
@@ -353,12 +353,16 @@ $(document).ready(function(){
353353

354354
$(mainWidget.softwareCompetition.groups).each(function(i, val){
355355
if (additionGroups.indexOf(val) > -1){
356-
currentData.unshift({id: val, name: mainWidget.softwareCompetition.groupNames[i], disabled: true, selected: true})
356+
currentData.unshift({id: val, name: mainWidget.softwareCompetition.groupNames[i], selected: true})
357357
}
358358
});
359359
groupCancel = true;
360+
if (currentData.length > 0 ){
361+
jQuery_1_11_1("#groups").magicSuggest().enable();
362+
}
360363
jQuery_1_11_1("#groups").magicSuggest().setData(currentData);
361364
jQuery_1_11_1("#groups").magicSuggest().setValue(mainWidget.softwareCompetition.groups);
365+
362366
groupCancel = false;
363367
},
364368
function(errorMessage) {

src/web/scripts/magicsuggest.js

+3-8
Original file line numberDiff line numberDiff line change
@@ -357,9 +357,7 @@
357357
/**
358358
* type to validate against
359359
*/
360-
vtype: null,
361-
362-
selected: 'selected'
360+
vtype: null
363361
};
364362

365363
var conf = $.extend({},options);
@@ -1042,11 +1040,8 @@
10421040
'class': 'ms-sel-item ' + cfg.selectionCls + validCls,
10431041
html: selectedItemHtml
10441042
}).data('json', value);
1045-
var canDelete = true;
1046-
if (typeof(value[cfg.selected]) !== 'undefined' && value[cfg.selected] === true) {
1047-
canDelete = false;
1048-
}
1049-
if(cfg.disabled === false && canDelete){
1043+
1044+
if(cfg.disabled === false){
10501045
// small cross img
10511046
delItemEl = $('<span/>', {
10521047
'class': 'ms-close-btn'

0 commit comments

Comments
 (0)