X-Git-Url: https://git.mdrn.pl/fnpeditor.git/blobdiff_plain/30cd9b94ad82e3c3e1551fb8688eca6144f4a0f6..4a081f65f754c79a437d983ee1a22c60f97ee784:/src/editor/modules/documentToolbar/actionView.js diff --git a/src/editor/modules/documentToolbar/actionView.js b/src/editor/modules/documentToolbar/actionView.js index ddef396..114eb32 100644 --- a/src/editor/modules/documentToolbar/actionView.js +++ b/src/editor/modules/documentToolbar/actionView.js @@ -1,6 +1,7 @@ define(function(require) { 'use strict'; +/* globals gettext */ var $ = require('libs/jquery'), Backbone = require('libs/backbone'), @@ -44,6 +45,12 @@ var ActionView = Backbone.View.extend({ var actionState = this.action.getState(); + if(!actionState) { + this.$el.html(buttonTemplate({label: gettext('error :('), iconName:''})); + this._button().attr('disabled', true); + return; + } + var templateContext = { label: actionState.label || '?', iconName: (iconExists(actionState.icon)) ? actionState.icon : null,