(function ($, app) {
	var TablesModel = app.Models._Tables;

	TablesModel.prototype.getDefaultRenderer = function() {
		return Handsontable.renderers.DefaultProRenderer;
	};
	TablesModel.prototype.saveTable = function(preview, rerender) {
		this._saveTable(preview, rerender);
		app.Editor.Conditions.saveConditions();
	};
	TablesModel.prototype._setFormatToDiagramsAxis = function(value, type) {
		value = value.replace(/[0-9]{1}/g, '#').replace(/\s+/g, '');
		$('select[name="hAxis[format]"] option[data-type="' + type + '"]').attr('value', value);
		$('select[name="vAxis[format]"] option[data-type="' + type + '"]').attr('value', value);
	};
	TablesModel.prototype.controlSettingsValues = function($element) {
		this._controlSettingsValues($element);
		if($element.is('#google-tables-automatically-update')) {
			if($('#google-tables-link').val().length) {
				$element.removeAttr('data-preview-not-redraw').attr('data-need-settings-save', '1');
			}
		}
	};
}(window.jQuery, window.supsystic.Tables));