From 605b158b4dc315c52bd30c9839fb00a71b975461 Mon Sep 17 00:00:00 2001 From: Kristjan Date: Mon, 20 Jul 2015 00:31:49 +0200 Subject: [PATCH] Bug fix: fixed paper-textare key --- ng-polymer-elements.js | 2 +- ng-polymer-elements.min.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ng-polymer-elements.js b/ng-polymer-elements.js index 2af27e5..e9f894e 100644 --- a/ng-polymer-elements.js +++ b/ng-polymer-elements.js @@ -44,7 +44,7 @@ var allMappings = { ironSelector: multiSelectableMappings, paperInput: inputMappings, - paperTextArea: inputMappings, + paperTextarea: inputMappings, paperRadioGroup: selectorMappings, paperTabs: selectorMappings, paperMenu: multiSelectableMappings, diff --git a/ng-polymer-elements.min.js b/ng-polymer-elements.min.js index 0525499..f2931b1 100644 --- a/ng-polymer-elements.min.js +++ b/ng-polymer-elements.min.js @@ -1 +1 @@ -!function(angular){angular.module("ng-polymer-elements",[]).config(["$compileProvider","$injector",function($compileProvider,$injector){"use strict";var inputMappings={ngModel:"=value",ngDisabled:"=disabled",ngFocused:"=focused"},selectorMappings={ngModel:"=selected"},multiSelectableMappings={ngModel:function(element){return element.hasAttribute("multi")?"selectedValues":"selected"}},checkMappings={ngModel:"=checked",ngDisabled:"=disabled",ngChange:"&iron-change"},allMappings={ironSelector:multiSelectableMappings,paperInput:inputMappings,paperTextArea:inputMappings,paperRadioGroup:selectorMappings,paperTabs:selectorMappings,paperMenu:multiSelectableMappings,paperCheckbox:checkMappings,paperToggleButton:checkMappings,paperDialog:{ngOpened:"=opened",ngOverlayOpened:"&iron-overlay-opened",ngOverlayClosed:"&iron-overlay-closed"},paperSlider:{ngModel:"=value",ngChange:"&value-change",ngDisabled:"=disabled"},goldEmailInput:inputMappings,goldPhoneInput:inputMappings,goldCcInput:{ngModel:"=value",ngDisabled:"=disabled",ngFocused:"=focused",ngCardType:"=cardType"},goldCcExpirationInput:inputMappings,goldCcCvcInput:inputMappings,goldZipInput:inputMappings,googleFeeds:{ngModel:"=results",loading:"=loading",ngError:"&google-feeds-error",ngQueryError:"&google-feeds-queryerror",ngQueryResponse:"&google-feeds-queryresponse",ngResponse:"&google-feeds-response",ngMultiResponse:"&google-multi-feeds-response"},googleMap:{ngMap:"=map",ngLatitude:"=latitude",ngLongitude:"=longitude"},googleSheets:{ngRows:"=rows",ngSheet:"=sheet",ngTab:"=tab"}};if($injector.has("$ngPolymerMappings")){var extendedMappings=$injector.get("$ngPolymerMappings");angular.extend(allMappings,extendedMappings)}Object.keys(allMappings).forEach(function(tag){var mappings=allMappings[tag];$compileProvider.directive(tag,["$parse","$window",function($parse,$window){var scopeDefinition={},keys=Object.keys(mappings);return keys.forEach(function(attr){var mappingType,mapped=mappings[attr];switch(typeof mapped){case"string":if(mappingType=mapped.charAt(0),"="!==mappingType&&"&"!==mappingType)throw'Invalid mapping: "'+mapped+'" - must begin with "=" or "&"';mapped=mapped.substr(1);break;case"function":switch(mapped.name){case"property":mappingType="=";break;case"event":mappingType="&";break;default:throw'Invalid mapping for "'+attr+'" - function name must be "property" or "event"'}break;default:throw'Invalid mapped type for "'+attr+'" - must be string or function'}scopeDefinition[attr]=mappingType}),{restrict:"E",scope:scopeDefinition,link:function(scope,element,attrs){var el=element[0],observers={};scope.$on("$destroy",function(){Object.keys(observers).forEach(function(key){var observer=observers[key];Object.unobserve(el[key],observer)})}),keys.forEach(function(attr){if(attrs[attr]){var mappingType,mapped=mappings[attr];if("function"==typeof mapped?(mappingType="property"===mapped.name?"=":"&",mapped=mapped(el)):(mappingType=mapped.charAt(0),mapped=mapped.substr(1)),"&"===mappingType){var fn=$parse(attrs[attr]);el.addEventListener(mapped,function(e){scope.$apply(function(){fn(scope.$parent,{$event:e})})})}else{var propertyName=mapped,propertyInfo=el.getPropertyInfo(mapped),propertyType=propertyInfo.type,readOnly=propertyInfo.readOnly;if(!readOnly&&!el[propertyName])switch(propertyType){case Array:el[propertyName]=[];break;case Object:el[propertyName]={}}var attachObserver=function(){if(!readOnly)switch(observers[propertyName]&&(Object.unobserve(el[propertyName],observers[propertyName]),delete observers[propertyName]),propertyType){case Array:case Object:observers[propertyName]=function(){scope.$apply(function(){scope[attr]||(scope[attr]=propertyType===Array?[]:{}),angular.copy(el[propertyName],scope[attr])})},Object.observe(el[propertyName],observers[propertyName])}};attachObserver();var handler=function(){setTimeout(function(){var value=scope[attr];propertyType!=Array&&propertyType!=Object?void 0!==value&&(el[propertyName]=value):value&&(el[propertyName]=angular.copy(value),attachObserver())})};readOnly||(scope.$watch(attr,handler,!0),handler(scope[attr]));var eventName=propertyName.replace(/([A-Z])/g,function($1){return"-"+$1.toLowerCase()})+"-changed";el.addEventListener(eventName,function(event){var value=el[propertyName];el.async(function(){scope.$apply(function(){propertyType===Array||propertyType===Object?scope[attr]=angular.copy(value):scope[attr]!=value&&(scope[attr]=value)}),attachObserver()})})}}})}}}])})}])}(angular); \ No newline at end of file +!function(angular){angular.module("ng-polymer-elements",[]).config(["$compileProvider","$injector",function($compileProvider,$injector){"use strict";var inputMappings={ngModel:"=value",ngDisabled:"=disabled",ngFocused:"=focused"},selectorMappings={ngModel:"=selected"},multiSelectableMappings={ngModel:function(element){return element.hasAttribute("multi")?"selectedValues":"selected"}},checkMappings={ngModel:"=checked",ngDisabled:"=disabled",ngChange:"&iron-change"},allMappings={ironSelector:multiSelectableMappings,paperInput:inputMappings,paperTextarea:inputMappings,paperRadioGroup:selectorMappings,paperTabs:selectorMappings,paperMenu:multiSelectableMappings,paperCheckbox:checkMappings,paperToggleButton:checkMappings,paperDialog:{ngOpened:"=opened",ngOverlayOpened:"&iron-overlay-opened",ngOverlayClosed:"&iron-overlay-closed"},paperSlider:{ngModel:"=value",ngChange:"&value-change",ngDisabled:"=disabled"},goldEmailInput:inputMappings,goldPhoneInput:inputMappings,goldCcInput:{ngModel:"=value",ngDisabled:"=disabled",ngFocused:"=focused",ngCardType:"=cardType"},goldCcExpirationInput:inputMappings,goldCcCvcInput:inputMappings,goldZipInput:inputMappings,googleFeeds:{ngModel:"=results",loading:"=loading",ngError:"&google-feeds-error",ngQueryError:"&google-feeds-queryerror",ngQueryResponse:"&google-feeds-queryresponse",ngResponse:"&google-feeds-response",ngMultiResponse:"&google-multi-feeds-response"},googleMap:{ngMap:"=map",ngLatitude:"=latitude",ngLongitude:"=longitude"},googleSheets:{ngRows:"=rows",ngSheet:"=sheet",ngTab:"=tab"}};if($injector.has("$ngPolymerMappings")){var extendedMappings=$injector.get("$ngPolymerMappings");angular.extend(allMappings,extendedMappings)}Object.keys(allMappings).forEach(function(tag){var mappings=allMappings[tag];$compileProvider.directive(tag,["$parse","$window",function($parse,$window){var scopeDefinition={},keys=Object.keys(mappings);return keys.forEach(function(attr){var mappingType,mapped=mappings[attr];switch(typeof mapped){case"string":if(mappingType=mapped.charAt(0),"="!==mappingType&&"&"!==mappingType)throw'Invalid mapping: "'+mapped+'" - must begin with "=" or "&"';mapped=mapped.substr(1);break;case"function":switch(mapped.name){case"property":mappingType="=";break;case"event":mappingType="&";break;default:throw'Invalid mapping for "'+attr+'" - function name must be "property" or "event"'}break;default:throw'Invalid mapped type for "'+attr+'" - must be string or function'}scopeDefinition[attr]=mappingType}),{restrict:"E",scope:scopeDefinition,link:function(scope,element,attrs){var el=element[0],observers={};scope.$on("$destroy",function(){Object.keys(observers).forEach(function(key){var observer=observers[key];Object.unobserve(el[key],observer)})}),keys.forEach(function(attr){if(attrs[attr]){var mappingType,mapped=mappings[attr];if("function"==typeof mapped?(mappingType="property"===mapped.name?"=":"&",mapped=mapped(el)):(mappingType=mapped.charAt(0),mapped=mapped.substr(1)),"&"===mappingType){var fn=$parse(attrs[attr]);el.addEventListener(mapped,function(e){scope.$apply(function(){fn(scope.$parent,{$event:e})})})}else{var propertyName=mapped,propertyInfo=el.getPropertyInfo(mapped),propertyType=propertyInfo.type,readOnly=propertyInfo.readOnly;if(!readOnly&&!el[propertyName])switch(propertyType){case Array:el[propertyName]=[];break;case Object:el[propertyName]={}}var attachObserver=function(){if(!readOnly)switch(observers[propertyName]&&(Object.unobserve(el[propertyName],observers[propertyName]),delete observers[propertyName]),propertyType){case Array:case Object:observers[propertyName]=function(){scope.$apply(function(){scope[attr]||(scope[attr]=propertyType===Array?[]:{}),angular.copy(el[propertyName],scope[attr])})},Object.observe(el[propertyName],observers[propertyName])}};attachObserver();var handler=function(){setTimeout(function(){var value=scope[attr];propertyType!=Array&&propertyType!=Object?void 0!==value&&(el[propertyName]=value):value&&(el[propertyName]=angular.copy(value),attachObserver())})};readOnly||(scope.$watch(attr,handler,!0),handler(scope[attr]));var eventName=propertyName.replace(/([A-Z])/g,function($1){return"-"+$1.toLowerCase()})+"-changed";el.addEventListener(eventName,function(event){var value=el[propertyName];el.async(function(){scope.$apply(function(){propertyType===Array||propertyType===Object?scope[attr]=angular.copy(value):scope[attr]!=value&&(scope[attr]=value)}),attachObserver()})})}}})}}}])})}])}(angular); \ No newline at end of file