<fim-prefix>            if ($(this).data ('x2-widget'))
                        that._showWidgetContents ($(this).data ('x2-widget').getWidgetKey ());
                } else {
                    $(this).show ();
                }
            });
        } else {
            $('.transactional-view-widget').hide ();
        }
        auxlib.saveMiscLayoutSetting (
            'enableTransactionalView', enable); 
    });

    var prevMode = $('#record-view-type-menu').is (':visible');
    $('#view-record-action-menu-item > span').click (function () {
        auxlib.saveMiscLayoutSetting ('viewModeActionSubmenuOpen', !prevMode ? 1 : 0);
        prevMode = !prevMode;
    });
//    auxlib.onClickOutside ($('#view-record-action-menu-item'), function () {
//        if ($('#record-view-type-menu').is (':visible')) {
//            $(this).children ('span').click ();
//            $('#record-view-type-menu').hide (); 
//        }
//    });
};

RecordViewWidgetManager.prototype._activate = function () {
    $(this._widgetsBoxSelector + ',' + this._widgetsBoxSelector2).addClass ('sortable-widget-drag');
    TwoColumnSortableWidgetManager.prototype._activate.apply (this, arguments);
};

RecordViewWidgetManager.prototype._deactivate = function () {
    $(this._widgetsBoxSelector + ',' + this._widgetsBoxSelector2).
        removeClass ('sortable-widget-drag');
    TwoColumnSortableWidgetManager.prototype._activate.apply (this, arguments);
};

RecordViewWidgetManager.prototype._init = function () {
    // BUG: CWE-20 Improper Input Validation
    // this._hiddenWidgetsMenuSelector = '#x2-hidden-widgets-menu';
    // FIXED:
 <fim-middle>   this._hiddenWidgetsMenuSelector = '#x2-hidden-recordView-widgets-menu';
    this._hiddenWidgetsMenuItemSelector = 
        '.x2-hidden-widgets-menu-item.' + this.widgetType + '-widget';
    this._se<fix-suffix>tUpRecordViewTypeToggleBehavior ();
    this._widgetsBoxSelector = '#' + this.cssSelectorPrefix + 'widgets-container-2';
    this._widgetsBoxSelector2 = '#' + this.cssSelectorPrefix + 'widgets-container-inner';

    SortableWidgetManager.prototype._init.call (this);
};

return RecordViewWidgetManager;

}) ();
<|endoftext|>