Пример #1
0
export function openGallery( itemEl ) {
	const galleryEl = closest( itemEl, 'div.gallery' );
	const galleryId = galleryEl.getAttribute( 'id' );

	return ( dispatch, getState ) => {
		const { galleries } = getState();
		let group = find( galleries.groups, { id: galleryId });

		if ( ! group ) {
			group = createGallery( galleryEl );

			dispatch( addGallery( group ) );
		}

		const allItems = galleryEl.querySelectorAll( '.gallery-item' );
		const itemIndex = indexOf( allItems, itemEl );

		dispatch({
			type:  GALLERY_OPEN,
			id:    galleryId,
			index: itemIndex,
			thumb: itemEl
		});
	};
}
Пример #2
0
 _this.setNeverShown = function (column) {
     var rootNode = ReactDOM.findDOMNode(_this);
     var filterBelongToScrollBody = !!closest(rootNode, '.ant-table-scroll');
     if (filterBelongToScrollBody) {
         // When fixed column have filters, there will be two dropdown menus
         // Filter dropdown menu inside scroll body should never be shown
         // To fix https://github.com/ant-design/ant-design/issues/5010 and
         // https://github.com/ant-design/ant-design/issues/7909
         _this.neverShown = !!column.fixed;
     }
 };
Пример #3
0
function destroy (e) {
  let id = closest(e.target, 'li').getAttribute('data-id')
  events.emit('player:remove', id)
}