common/corpus-common-addon/addon/components/doc-literal.js
author ymh <ymh.work@gmail.com>
Fri, 18 Nov 2016 14:48:49 +0100
changeset 428 76a47f714766
parent 141 c0e8626a271c
child 502 74fba571487e
permissions -rw-r--r--
add memcached configuration option, small corrections for the build process and add installDrupal.sh file to the release

import Ember from 'ember';
import layout from '../templates/components/doc-literal';

export default Ember.Component.extend({
  layout: layout,
  tagName: 'span',
  value: Ember.computed('url', function() {
    var url = this.get('url');
    if(typeof url === 'string') {
      return url;
    }
    else if (typeof url === 'object' && !Array.isArray(url) && 'value' in url) {
      return url['value'];
    }
    else {
      return null;
    }
  }),
  lang: Ember.computed('url', function() {
    var url = this.get('url');
    if (typeof url === 'object' && !Array.isArray(url) && 'lang' in url) {
      return url['lang'];
    }
    else {
      return null;
    }
  }),
  datatype: Ember.computed('url', function() {
    var url = this.get('url');
    if (typeof url === 'object' && !Array.isArray(url) && 'datatype' in url) {
      return url['datatype'];
    }
    else {
      return null;
    }
  })

});