import { RouteHandler } from 'wee-routes';
import $ from 'wee-dom';
import $events from 'wee-events';
import classes from '../../scripts/classes';

function bindEvents() {
	const wrap = '.js-gallery-thumb-wrap';

	$events.on(wrap, 'click.gallery', (e, el) => {
		const $thumb = $(el);

		$(wrap).removeClass(classes.active);

		$('.js-gallery-main-image').attr('src', $thumb.find('.js-gallery-thumb').attr('src'));

		$thumb.addClass(classes.active);
	});
}

export default new RouteHandler({
	init() {
		bindEvents();
	},
	unload: 'gallery'
});
@@ -145,45 +145,37 @@
 ';%0A%0A
-function bindEvents() %7B%0A%09const 
+const localClasses = %7B%0A%09
 wrap
- =
+:
  '.j
@@ -199,23 +199,62 @@
 rap'
+%0A%7D
 ;%0A%0A
-%09$events.on(
+function bindEvents() %7B%0A%09$events.on(localClasses.
 wrap
@@ -314,16 +314,29 @@
 );%0A%0A%09%09$(
+localClasses.
 wrap).re
@@ -341,25 +341,30 @@
 removeClass(
-c
+localC
 lasses.activ
@@ -476,17 +476,22 @@
 ddClass(
-c
+localC
 lasses.a

Refactor image-gallery component