cms/app-client/app/helpers/annotation-content.js
changeset 460 686926d132ff
child 467 762fc0eb4946
equal deleted inserted replaced
459:6a296e92887f 460:686926d132ff
       
     1 import Ember from 'ember';
       
     2 
       
     3 export function annotationContent(params/*, hash*/) {
       
     4   if(!params || params.length==0) {
       
     5     return "";
       
     6   }
       
     7 
       
     8   let content = params[0];
       
     9   if(typeof content === "string") {
       
    10     return content;
       
    11   } else if(typeof content === "object") {
       
    12     let res = `[ ${content.ctype}`;
       
    13     for(let k in content) {
       
    14       if(k !== 'ctype') {
       
    15         res += `, ${k}: ${content[k]}`;
       
    16       }
       
    17     }
       
    18     return res + " ]";
       
    19   } else {
       
    20     return content;
       
    21   }
       
    22 }
       
    23 
       
    24 export default Ember.Helper.helper(annotationContent);