@@ -4,7 +4,6 @@ import Controller from '@ember/controller';
44import PromiseProxyMixin from '@ember/object/promise-proxy-mixin' ;
55import ArrayProxy from '@ember/array/proxy' ;
66import { computed , observer } from '@ember/object' ;
7- import { later } from '@ember/runloop' ;
87import moment from 'moment' ;
98
109const NUM_VERSIONS = 5 ;
@@ -25,6 +24,9 @@ export default Controller.extend({
2524 fetchingFollowing : true ,
2625 following : false ,
2726 currentVersion : alias ( 'model' ) ,
27+ crateTomlText : computed ( 'crate.name' , 'currentVersion.num' , function ( ) {
28+ return `${ this . get ( 'crate.name' ) } = "${ this . get ( 'currentVersion.num' ) } "` ;
29+ } ) ,
2830 requestedVersion : null ,
2931 keywords : alias ( 'crate.keywords' ) ,
3032 categories : alias ( 'crate.categories' ) ,
@@ -152,30 +154,7 @@ export default Controller.extend({
152154 return data ;
153155 } ) ,
154156
155- toggleClipboardProps ( isSuccess ) {
156- this . setProperties ( {
157- showSuccess : isSuccess ,
158- showNotification : true ,
159- } ) ;
160- later (
161- this ,
162- ( ) => {
163- this . set ( 'showNotification' , false ) ;
164- } ,
165- 2000 ,
166- ) ;
167- } ,
168-
169157 actions : {
170- copySuccess ( event ) {
171- event . clearSelection ( ) ;
172- this . toggleClipboardProps ( true ) ;
173- } ,
174-
175- copyError ( ) {
176- this . toggleClipboardProps ( false ) ;
177- } ,
178-
179158 toggleFollow ( ) {
180159 this . set ( 'fetchingFollowing' , true ) ;
181160
0 commit comments