/*!
 * This source file is part of the open source project
 * ExpressionEngine (https://expressionengine.com)
 *
 * @link      https://expressionengine.com/
 * @copyright Copyright (c) 2003-2022, Packet Tide, LLC (https://www.packettide.com)
 * @license   https://expressionengine.com/license Licensed under Apache License, Version 2.0
 */

/*jslint browser: true, onevar: true, undef: true, nomen: true, eqeqeq: true, plusplus: true, bitwise: true, regexp: false, strict: true, newcap: true, immed: true */

/*global $, jQuery, EE, window, document, console, alert */

"use strict";

$(document).ready(function () {
	$('.tab .arrow-list li a').on('click', function (e) {
		var textarea = $('textarea[name="template_data"]'),
		    editor = textarea.data('codemirror.editor');

			editor.replaceSelection($(this).text());
			editor.refresh();

			e.preventDefault();
	});
});
